viewing request information

fguihen

Junior Contributor
Joined
Nov 10, 2003
Messages
248
Location
Eire
is there an event in asp.net 1.1 thats triggered when a request for the page is recieved? i want to take info from this request ( browser type , location ) and what not.
 
Just add a global.asax file to your project. You can then hook the page request with something like:
C#:
void Application_BeginRequest(Object Sender, EventArgs e)
{
    if (HttpContext.Current != null)
    {
        HttpRequest request = HttpContext.Current.Request;
    }
}
You may also want to have a look at the IHttpModule interface. There's a lot of examples around online for it. You can do some cool stuff by injecting yourself into various parts of the Request/Response streams.
 
Back
Top