The identity of the user has not been established when
Application_BeginRequest executes. If you need to access User.Identity,
you'll need to choose another event later in the request's life cycle.
I recommend reading the following document from the Patterns & Practices
site. It should give you a pretty thorough understanding of the life cycle
for an HTTP Request as it relates to ASP.NET.
http://msdn.microsoft.com/library/de...SecNetAP04.asp
HTH
----------------
Dave Fancher
http://www.davefancher.com
"Arjen" <> wrote in message
news:deo06r$isr$...
> Hi,
>
> I try to get the 'Context.User.Identity.Name' from inside the global.asax
> in the 'Application_BeginRequest' event.
>
> I get this error message:
> Object reference not set to an instance of an object.
>
> You can simple test this with:
> Response.Write(Context.User.Identity.Name);
>
> How can I get there the name?
>
> Thanks!
>