Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 05, 2013 03:59 PM by francissvk
Jan 05, 2013 02:01 PM|LINK
in my asp.net web forms app on master page's page load event I call a method "GetCurrentUserFullName()" to retrieve current logged in user's full name and display on top of the page. When every page that uses this master page is loaded,
the master page method GetCurrentUserFullName() is called again. This is rather expensive and I'd like a way to persist the current user's full name after it's retrieved once.
what's the best solution for this situation? session? viewstate? or anything else?
thanks in advance
Jan 05, 2013 02:08 PM|LINK
The best method is to create a session variable in which to store the username and to check if the value is null, so only on the first load you will get the username. You could read more at
how to use session state in ASP.NET.
Jan 05, 2013 03:59 PM|LINK
you can achive your requirement by any one of these:
2. Query string
4. Hidden controls
But in security concern First one (Session) is best. The other 3 can be easily tampered. So go with session variable.