I am working on dynamic menus. Using Session Variable by passing whole object. As can be seen from controller:
Session[\"PackageSbMenu2\"] = QueryHelper.Get_
You need to cast your Session object
@{ var menu = Session["PackageSbMenu2"] as List<MenusDM>; if(menu != null) { foreach(var t in menu) { <li><a href=@Html.ActionLink(t.Controller, t.Action)>t.Name</a></li> } } }