As the hastable stores the keyvaluespair values, you have to store keyvalue pair in hastable.
refer the following example for the same.. in this example i am storing data in session variable from one page and access it in to another page.
hope this will help you.
default.aspx.cs
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
Dictionary<int, string> dict = new Dictionary<int, string>();
dict.Add(1, "value1");
dict.Add(2, "value2");
Hashtable ht = new Hashtable(dict);
Session["data"] = ht;
Response.Redirect("default2.aspx", false);
}
catch (Exception)
{
throw;
}
}
}
default2.aspx.cs
public partial class default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["data"] != null)
{
Hashtable ht = Session["data"] as Hashtable;
}
}
}