Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Change event sequence

Reply
Thread Tools

Change event sequence

 
 
Redhairs
Guest
Posts: n/a
 
      01-10-2008
I created two base page class and a webform to inherit them as blow.

Public Class BasePage:System.Web.UI.Page
{
protected override void OnPreInit(EventArgs e)
{ base.OnPreInit(e); }
}


Public Class ContentPage : BasePage
{
protected override void OnPreInit(EventArgs e)
{ base.OnPreInit(e); }
}

WebForm.aspx inherit theContentPage class

Then the event execution order is the Page_PreInit() ->
BasePage.OnPreInit() -> ContentPage.OnPreInit()
How to change the execution sequence as below?
(1) ContentPage.OnPreInit()
(2) BasePage.OnPreInit()
(3) Page_PreInit()


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      01-10-2008
its all an when you call the base routine try:

Public Class BasePage:System.Web.UI.Page
{
protected override void OnPreInit(EventArgs e)
{
// do base page stuff

base.OnPreInit(e); // fires Page_PreInit()
}
}


Public Class ContentPage : BasePage
{
protected override void OnPreInit(EventArgs e)
{
// do content stuff here

base.OnPreInit(e); // fire basepage
}
}

-- bruce (sqlwork.com)


"Redhairs" wrote:

> I created two base page class and a webform to inherit them as blow.
>
> Public Class BasePage:System.Web.UI.Page
> {
> protected override void OnPreInit(EventArgs e)
> { base.OnPreInit(e); }
> }
>
>
> Public Class ContentPage : BasePage
> {
> protected override void OnPreInit(EventArgs e)
> { base.OnPreInit(e); }
> }
>
> WebForm.aspx inherit theContentPage class
>
> Then the event execution order is the Page_PreInit() ->
> BasePage.OnPreInit() -> ContentPage.OnPreInit()
> How to change the execution sequence as below?
> (1) ContentPage.OnPreInit()
> (2) BasePage.OnPreInit()
> (3) Page_PreInit()
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to iterate over sequence and non-sequence ? stef mientki Python 13 10-20-2007 10:21 AM
A Paradise DNS address change? What change? There was no change. Tony Neville NZ Computing 7 09-22-2006 01:02 PM
Event Sequence Wrong Josh ASP .Net 1 08-17-2005 11:22 AM
PostBack Event Firing Sequence Guadala Harry ASP .Net 3 08-15-2004 07:42 AM
BOOT SEQUENCE (how to change boot sequence) bird Computer Support 13 12-24-2003 02:20 AM



Advertisments