What is FIRST event on Page to Calculate Session Variables?

  • Thread starter Thread starter Earl Teigrob
  • Start date Start date
E

Earl Teigrob

I have a small application that consists of one aspx page with inline and
dynamically loaded user and custom controls. When the page loads, I need to
calculate a set of global SESSION variables that will be used by the loaded
controls.



The problem I am having in finding a place where the session variables will
be calculated before any of the page controls or dynamically loaded controls
try to access them.



If I try to calculate the session variables in the page_load event, some of
the user controls that are on the page itself try to use these variables
before the page_load event fires. Same thing with page_init.



Two contraints I have is the need use Page.IsPostBack and
Request.QueryString



I thought maybe the application_request of the global.asax would work but
the QueryString parameters are not available yet.



So here is the question.



Can I set session variables somewhere where I can guarantee they are the
first thing that is calculated and can still access the Page.IsPostBack and
Request.QueryString members?



Thanks for your help



Earl
 
Hi,

I cant see how user control event take place before the page OnInut. but
anyway CreateControlCollection called befor page onInit and querystring
available.

override protected System.Web.UI.ControlCollection
CreateControlCollection ()
{
object o = HttpContext.Current.Request.QueryString;
return base.CreateControlCollection();
}


Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
Back
Top