W
William Parker
I have a user web control I wrote which is registered in my webforms. By
default the web form's Page_Load is firing first, and then the web user
control's Page_Load is firing.
I want to set it up so that the web control's event fires first, before the
web form's (or any other controls page_load fires). Is this possible?
Consider this hidden code section (hidden by VS.NET by default) in the web
control's user form:
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
Would it be possible for me to write code that enumerated all the registered
events and then rewrote them back in an order to ensure its Page_Load was
called first? Or perhaps there is an easier way for me to accomplish this?
Also, as a side note, is the Page_Load event the first event to fire on a
page? For example I'm looking to do something on the page that happens at
the very beginning that the page is called. Not at the httpmodule level,
but ideally there would be no processing prior to the point where I could do
some things - if Page_Load is not the event is there another one I can
capture?
Thanks.
default the web form's Page_Load is firing first, and then the web user
control's Page_Load is firing.
I want to set it up so that the web control's event fires first, before the
web form's (or any other controls page_load fires). Is this possible?
Consider this hidden code section (hidden by VS.NET by default) in the web
control's user form:
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
Would it be possible for me to write code that enumerated all the registered
events and then rewrote them back in an order to ensure its Page_Load was
called first? Or perhaps there is an easier way for me to accomplish this?
Also, as a side note, is the Page_Load event the first event to fire on a
page? For example I'm looking to do something on the page that happens at
the very beginning that the page is called. Not at the httpmodule level,
but ideally there would be no processing prior to the point where I could do
some things - if Page_Load is not the event is there another one I can
capture?
Thanks.