Contributor
2104 Points
813 Posts
Jun 29, 2011 10:00 PM|suresh_g_v2002|LINK
you can't assign a method to a session..., you can put the data returned from that method into session,
supose ur method is returning some string values which is retrieved from database..,you can use like this
private string GetValue()
{
....//some database stuff...
return "asp.net";
}
Adding to session
Session["somekey"] = GetValue()
Reading from session
string strValue = Session["somekey"].ToString();
Contributor
2104 Points
813 Posts
Re: how to store page's data into session
Jun 29, 2011 10:00 PM|suresh_g_v2002|LINK
you can't assign a method to a session..., you can put the data returned from that method into session,
supose ur method is returning some string values which is retrieved from database..,you can use like this
private string GetValue()
{
....//some database stuff...
return "asp.net";
}
Adding to session
Session["somekey"] = GetValue()
Reading from session
string strValue = Session["somekey"].ToString();