Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
c# code to display username in login page after registering in signup page in ASP.NET
Posted
Comments
HinaMehta 22-Sep-11 10:25am    
After registering,your application goes to the Home/Index Page or Login Page?In the login Page if you have the Username,ie if authentication is done,then why to go to back to the login page?can you pls explain a bit about the flow?

User.Identity.Name ???

Or perhaps

HttpContext.Current.User.Identity.Name

Depends on your situation.

Cheers!
 
Share this answer
 
Hi,

There are so many ways to do this .some of developer follow one method and another follow another methods

one method is storing username in session variable then use that session variable in any page.

Here 'm providing link for session
http://msdn.microsoft.com/en-us/library/ms178581.aspx


After creating session variable we use that variable in login method after complete verification of user

Let me Tell you the process of your requirement

frst step is creation of session variable write the below code in session start event in global.asax

C#
Session.Add("UserName", "");


After that write below code in login button
C#
  //if user is verified as registered user
Session["UserName"]=TxtUname.Text;


After this you can use that session variable in any page by using following code
C#
LblUserName.Text=Session["UserName"].Tostring();


I hope you understood What I said

All the Best
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900