0
我要做到以下幾點:淨MVC:綁定路線值會話值
用戶應該有自己的子網站上我的網站。爲此我已經添加了一個新的途徑:
routes.MapRoute(
"ShopEntered",
"{username}/{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
);
當網站被調用,第一次我想要的用戶名值存儲在會話,然後綁定會話價值路線的用戶名部分,所以當我調用Url.Action或Html.ActionLink時,我不必每次都手動設置它。
有誰知道我怎麼能意識到這一點?