It depends how you would like to use it.
If you want to get the Windows username you have to make sure you disabled
anonymous access in IIS.
If you use forms authentication you can make a custom principal:
System.Security.Principal.GenericIdentity identity = new
System.Security.Principal.GenericIdentity("testUse rName");
System.Security.Principal.GenericPrincipal principal = new
System.Security.Principal.GenericPrincipal(identit y,new string[]{
"TestRole"});
Context.User = principal;
Hope this helps,
Kristof
"luna" <lu**@themoon.com> wrote in message
news:e2**************@newsfep3-gui.server.ntli.net...
thanks but niether seems to work - aspx accepts it but it does nothing!
thanks
mark
"Kristof Van Praet" <kr**************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... In the codebehind of your aspx code, you could use:
Page.User.Identity.Name ;
In a custom class, you could use:
HttpContext.Current.User.Identity.Name;
Hope this helps,
Kristof
"luna" <lu**@themoon.com> wrote in message
news:05**************@newsfep3-gui.server.ntli.net... in vb its system.environment.username - whats the equivalent in aspx with code behind (VB) ??
cheers
mark