i have values inside a hashtable list like this
i need the values inside of this.I dont know how .
view
@foreach (var e in ViewData.Model )
{
//code which i need
}
Controller
public ActionResult test()
{
List<cart> cart=new List<Models.cart>();
Hashtable ht = (Hashtable)Session["cart"];
return View(ht);
}
Thanks in Advance
You are trying to access session from cshtml so you could do directly access:
or as you are setting Model by View(ht);
you can have by Model:
I have done this in a different way
and it works well