|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to get the user name after FormAuthenticationhi,
I'm new to .aspx and want to ask a question about FormAuthentication. I've created a login page and a default page, it works well in the login page and can redirect to the default page. The problem is I want to get the login name in the default page, what function should I use? Thanks in advance. Vivian hi Vivian,
User.Identity.Name will give you the username of the current user. this is the generic 'Identity' object, which provides a basic set of information for all the authentication types. if your code is outside a code-behind file (i.e. outside a Page context), you can use HttpContext.Current.User.Identiy.Name to get the same information. hope this helps tim Show quoteHide quote "Vivian" <wki***@hotmail.com> wrote in message news:uJkrLOy0GHA.4044@TK2MSFTNGP04.phx.gbl... > hi, > > I'm new to .aspx and want to ask a question about FormAuthentication. > I've created a login page and a default page, it works well in the login > page and can redirect to the default page. The problem is I want to get > the login name in the default page, what function should I use? > > Thanks in advance. > > Vivian >
[NEWBIE] Call an event from a javascript
VS 2005 .sln / web Solution Problem Operating System and H/W for new Dev Workstation Adding a System.Web.UI.WebControls.Panel to a DataGrid Cell Upgrading ASP.NET on my web server to the latest version UPS LandedCost webservice and ASP.NET 1.1 SharpForge - Open source C#/SourceForge implementation How to achieve this DropDownList from database and extra field Whine about VS gridline color |
|||||||||||||||||||||||