The life saver HttpContext.Current.Items["ParameterName"]
- by MoezMousavi
I got stocked passing parameter to one master page for some reasons, seems the page lifecycle and dynamic loading of the master pages has got some issues with defining public properties in the masterpage within my project. It did not set my values and as a result, properties became useless.
A collegue just mentioned using HttpContext. have a look what MSDN saying "Encapsulates all HTTP-specific information about an individual HTTP request" http://msdn.microsoft.com/en-us/library/system.web.httpcontext.aspx
HttpContext.Current.Items["ParameterName"]
Also, Page.Items could do the same thing. Page.Items, "Gets a list of objects stored in the page context" http://msdn.microsoft.com/en-us/library/system.web.ui.page.items.aspx as your master page and content page are rendered as a single document anyway.