Asp.Net News
Free Tech Magazines
Asp.Net Web Hosting
Suggest Us
Link to Us
Feeds Subscription
Questions & Answers
Tips & Tricks
 How to Display UserName And Last Login in Asp.Net MasterPage?
Posted by ramaniranjan das on  2/20/2010 6:37:50 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
Please Help me

I want display user name in master page after user logon

And display last login time

how It is possible

please sed me the in c # Asp.net2.0

Post Your Reply Post New Question

 Viewer's Reply
Display UserName And Last Login in Asp.Net MasterPage
Answered By Moderator1 on 2/20/2010 9:13:20 PM

After successful login, store the User Name and Last Login details of the user in Session Variable. Then in the master page write code to display it with the below syntax.

if (Session.Count > 0)
lblUserName.Text = "Logged in as " + Session["UserName"].ToString();
lblLastLogin.Text = "Logged in as " + Session["LastLogin"].ToString();

Please note that provide meaningful Subject for your questions and if you have any more doubts post it below this answer.
hw 2 store in session variable
Answered By priyanka on 3/10/2010 9:41:31 PM
hi .. how to store in session variable ? can u pls explain ..
Plz Ans asap
Answered By Irfan on 1/4/2012 10:37:32 PM
How can i store last login user information in session and how can i get back the session information and show it when a new user login.

I have to store the last user information who has made changes in the application rather than just visiting it!

plz send me as soon as possible.
Post Your Reply If you still have problem, post it again under this reply for better response.

Sponsored by
Introduction to Web Applications Development
Programmers Heaven C# School Book - Free 338 Page eBook
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!