I have a session in my Login Controller and there i send List of details via Session to the another page.So i need to take one item of the list to show in mvc view(Actially i need to show UserName in my mvc view).
My Controller
public ActionResult Login(User usrdtl, string returnUrl)
{
//some code here
List<UserDtl> usrList = newsManager.GetUserdetailsByuId(usrdtl.uId);
System.Web.HttpContext.Current.Session["UsrSession"] = usrList ;
}
This usrList consist of lots of user details,i need to show UserName in my view.
In my view i tries to take it as,
<span>@Session["UsrSession"] </span>
But it shows me error
System.Collections.Generic.List`1[NTL.Sys.Entities.UserDtl]
How can i get this ?