In my project i want store recently accessed Id's(like CompanyId) and based on Id's i need to display most recent 5 records on aspx webpage.For this i am using a session variable like below in my session class:
public static string RecentAssetList
{
get
{
return HttpContext.Current.Session["RECENT_ASSET_LIST"].ToString();
}
set
{
HttpContext.Current.Session["RECENT_ASSET_LIST"] = value;
}
}
And from my page storing the values into session like below.
string assetList = "";
assetList += assetId.ToString() + ",";
SessionData.RecentAssetList = assetList;
but it stores only one Id every time,if new record accessed session showing new one only. How can i store multiple values in my session based that values i want to get data from Database and display in my grid.