Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Unable to get Context.User.Identity.Name

Reply
Thread Tools

Unable to get Context.User.Identity.Name

 
 
Arjen
Guest
Posts: n/a
 
      08-26-2005
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!


 
Reply With Quote
 
 
 
 
Dave Fancher
Guest
Posts: n/a
 
      08-27-2005
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!
>



 
Reply With Quote
 
 
 
 
Arjen
Guest
Posts: n/a
 
      08-27-2005
Hi,

I know the problem, not the solution. I can't find the correct and first
event to get the User.Identity.
Can someone help?

Thanks!



"Dave Fancher" <> schreef in bericht
news:Q6-dnWG7Ctr3aZLeRVn-...
> 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!
>>

>
>



 
Reply With Quote
 
Arjen
Guest
Posts: n/a
 
      08-27-2005
I think I found it:
Application_PreRequestHandlerExecute

Arjen



"Arjen" <> schreef in bericht
news:depdfr$2oe$...
> Hi,
>
> I know the problem, not the solution. I can't find the correct and first
> event to get the User.Identity.
> Can someone help?
>
> Thanks!
>
>
>
> "Dave Fancher" <> schreef in bericht
> news:Q6-dnWG7Ctr3aZLeRVn-...
>> 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!
>>>

>>
>>

>
>



 
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
Unable to access HDD / Windows unable to complete format rmundy Hardware 1 08-13-2010 08:57 AM
Get ubuntu ! Get ubuntu ! Get ubuntu ! Get ubuntu ! Getubuntu Windows 64bit 1 06-01-2009 08:54 AM
unable to capture all the HTML of my page,or I'm unable to save it to disk Jake Barnes Javascript 6 02-08-2006 02:38 PM
Unable to renew IP address/unable to connect to wireless network =?Utf-8?B?SmFzZXlCb3k=?= Wireless Networking 1 12-22-2005 04:28 AM
Unable to see machines on the ethernet; Unable to find printers =?Utf-8?B?Sm9obiBN?= Wireless Networking 1 06-07-2005 03:32 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57