Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting page object reference at the Global.asax level
Message
 
To
07/07/2006 15:49:22
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01123781
Message ID:
01135562
Views:
16
Sure it will. A redirected page is another HTTP request. The event will fire both for the original page that Response.Redirect() is called on and then again in the page that is redirected to.

It won't fire if you use Server.Transfer() to go to another page because that stays in the same request context.

+++ Rick ---

>>Alternately you can try this (inside of global.asax) to get a reference to your page in the HttpApplication pipeline:
>>
>> public Global()
>> {
>> this.PreRequestHandlerExecute += new EventHandler(Global_PreRequestHandlerExecute);
>> }
>>
>> void Global_PreRequestHandlerExecute(object sender, EventArgs e)
>> {
>> System.Web.UI.Page pag = this.Context.Handler as System.Web.UI.Page;
>>
>> }
>
>In regards to this, I believe the PreRequestHandlerExecute() event does not fire on a redirect. If a page, during a postback, is redirecting to another page, this event will fire on the page doing the postback but not on the redirected page. So, I end up in the situation that oPage is not initialized for the redirected page. The redirected page appears ok however. But, the oPage reference still points to the page that did the postback because this event does not fire on a redirect.
>
>What do you recommend as far as adjustments go? Is the application factory class the only way to achieve that?
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform