i am designing web site using visual studio by asp .net,for authentication to the system i am using the login toolbox on the visual studio.And i want to use the username when i log in to system in another web form.But i can not reach it.How can i do? I can not use anythin inside "protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)".If i do, i am overwriting the existing function and it always return false.
On any page, you can access the currently logged-in user's username by simply accessing the common Principal object like so:
string username =this.User.Identity.Name;
The following walkthrough will help guide you through the process of setting up your login controls. It will also explain how you can retrieve the username once the user has been authenticated and "logged in." I might be misunderstanding your question, but it sounds to me like you have not created any user accounts with the CreateUserWizard control located in the Toolbox of Visual Studio under the "Login" tab. You can also set up accounts using the "ASP.NET Configuration" button, located at the top of the "Solutions Explorer" - there is an icon with a Globe and a Hammer that opens this tool.
I suggest that you go through the walkthrouh to better understand how the controls work...
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vwdcon/html/296c0be6-9ad5-4104-9a1b-a853986fa1a3.htm
[Edit]
I did not realize that I used local help. You can still access thisdocument by opening Internet Explorer and pasting this into the addressbar. I will attempt to locate the online version of this walkthrouh incase you have trouble accessing it locally
;
[Edit 2]
Okay, I located the online version of this. Head over tohttp://msdn2.microsoft.com/en-us/library/879kf95c(VS.80).aspx in order to view it online.
[/Edit 2]
0 comments:
Post a Comment