我在MVC 4有問題路由路由問題
我的網址是這樣的
http://localhost:portnumber/Session/View?Id=918&Pid=186
我想我的網址是這樣
http://localhost:portnumber/Session/View/918/186
我有看法喜歡這
@Html.RouteLink("more..", "Default", new {Controller="Session",Action="View",Id=e.Id,Pid=e.Pid })
routes.MapRoute(
name: "SessionView",
url: "{controller}/{action}/{Id}/{Pid}",
defaults: new { controller = "Session", action = "view", Id = UrlParameter.Optional, Pid = UrlParameter.Optional }
);
感謝您的回答,我的問題得到解決 – Mazher