我正在传递 empid,我希望它显示在 url 中,但它显示为查询字符串:
<li>@Html.ActionLink(key.Value, "Attendance","HOD", new {empid=key.Key}, null)
</li>
我要显示的链接如下:
/HOD/Attendance/xyz%2Fabc
但它向我展示了这样的:
/HOD/Attendance?empid=xyz%2Fabc //it's like query string but i don't want that.
有人可以帮忙吗?我很感激任何一点帮助。提前非常感谢。
我已将此 RouteMap 添加到 Global.asax
routes.MapRoute (
"HOD_AttByEmpID", // Route name
"{controller}/{action}/{empid}", // URL with parameters
new { controller = "Account", action = "LogOn",
empid = UrlParameter.Optional }
);