Hi,
Try this if could help...
Save this in
App_Code
Example:
public static class SessionManager
{
private const string USER_NAME = "UserName";
public static string UserName
{
get
{
if (HttpContext.Current.Session[USER_NAME] == null)
{
return string.Empty;
}
else
{
return HttpContext.Current.Session[USER_NAME].ToString();
}
}
set
{
HttpContext.Current.Session[USER_NAME] = value;
}
}
}
Example: Storing value...
SessionManager.UserName = "My Name";
Example: Retrieving value to next page:
string userName = SessionManager.UserName.ToString();
Happy coding...