Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting page object reference at the Global.asax level
Message
 
To
20/05/2006 23:49:38
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:
01123794
Views:
28
This message has been marked as the solution to the initial question of the thread.
>Is there a way to get a page object reference at teh Global.asax level? Presently, I have this in the Application_BeginRequest():

Not that way now.

What do you want to do exactly? If you want to not really use ASPX style pages create an HTTP Handler which will give you all the information you need with out the Page framework.

As to hooking in like you're trying to do: The page doesn't get created until much much later in the cycle during Handler execution. You can't do this sort of thing easily in Global nor do I think that's the right place. I think what you'll want is create a special HttpHandlerFactory that extends the standard ASP.NET Page handler factory and allows for the set up you need.

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;

}

+++ Rick ---

>
>
>    Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
>        LXFramework.oRequest = Request
>        LXFramework.oResponse = Response
>        LXFramework.oServer = Server
>        LXFramework.BeginRequest()
>    End Sub
>
>
>LXFramework contains a property oPage for the page object. So far, I was passing this object from the code behind of the page. I would like to avoid doing that in all pages. Is there a way to get a reference to the page object at this level?
+++ 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