Me implies that you are on a page - Context works everywhere...
> oops! it's always the simple things, isn't it? Incidentally,
> Me.User.Identity.Name also works. Is there a preferred method?
>
> "Dominick Baier" wrote:
>
>> Then i guess you have'nt disabled anonymous auth on your intranet
>> server
>> (in IIS)...
>> -----
>> Dominick Baier (
http://www.leastprivilege.com)
>> Developing More Secure Microsoft ASP.NET 2.0 Applications
>> (
http://www.microsoft.com/mspress/books/9989.asp)
>>
>>> No luck. This yields a blank string.
>>> These are my three lines of code:
>>> Response.Write(">" & Me.User.Identity.Name & "<<BR>")
>>> Response.Write(">" & System.Security.Principal.WindowsIdentity.
>>> GetCurrent().Name & "<<BR>")
>>> Response.Write(">" & Context.User.Identity.Name & "<")
>>> When run locally yields:
>>>> DOMAIN\USERNAME<
>>>> DOMAIN\USERNAME<
>>>> DOMAIN\USERNAME<
>>> When run on the Intranet yields:
>>>
>>>> <
>>>> WEBSERVERNAME\ASPNET<
>>>> <
>>> From
>>>
>>> "Dominick Baier" wrote:
>>>
>>>> Use
>>>>
>>>> Context.User.Identity.Name
>>>>
>>>> -----
>>>> Dominick Baier (
http://www.leastprivilege.com)
>>>> Developing More Secure Microsoft ASP.NET 2.0 Applications
>>>> (
http://www.microsoft.com/mspress/books/9989.asp)
>>>>> When I run my ASP.NET application from my development PC,
>>>>> Me.User.Identity.Name works. When I run it from my Intranet site,
>>>>> it does not. Any suggestions?
>>>>>