How can I show username without loginview control? [Resolved]

Posted by reddysankark-13471 under ASP.NET on 4/27/2012 | Points: 10 | Views : 1363 | Status : [Member] | Replies : 1
hi

i need coding for login view with out using membership class and controls how get the user name with normal coding

sankarreddy


Responses

Posted by: GSM_GSV on: 4/27/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
By using sessions

Step1: In the login page, carry the entered username through session

 Session["UserName"] = TxtUserName.text;


Step 2: In your home page you can get the value from session variable. Consider you have a label in homepage as "LblLoginName"

    LblLoginName.Text = Session["UserName"].Tostring();


Step 3: When user logout, you need to abandon the session

    Session["UserName"] = null


---------------------------------------
Live the life you've dreamed

Regards
MADHU

reddysankark-13471, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response