【发布时间】:2012-08-21 15:34:11
【问题描述】:
在我的 mvc2 项目中,一些 URL 显示在浏览器中,如下所示,
localhost:53289/Paper/ViewAgendaPaper?MeetingId=186&type=2&RefId=186
但我更喜欢这样,
localhost:53289/Paper/ViewAgendaPaper
在我的 Global.asax 中,
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Default", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
如何隐藏 URL 中的 id 字段。请给我一些想法。谢谢。
【问题讨论】:
标签: asp.net url asp.net-mvc-2 maproute