朋友们,我怎样才能在mvc视图中获得会话值。
我需要写那样的
@Html.ActionLink("Upload Images", "IndexBib", "Cataloging", new { Area = "Cataloging" },new {//session value for id parm//)
先谢谢
答案 0 :(得分:1)
@HttpContext.Current.Session["ID"].ToString()
答案 1 :(得分:1)
嗨,你可以这样做
@Html.ActionLink("Upload Images", "IndexBib", "Cataloging", new { Area = "Cataloging", id = (string)Session["param"]}, null)