通过asp.net mvc路由隐藏url中的参数
我有一个 asp.net mvc 2 应用程序。我得到一个 URL 为 http://localhost/Object/ChangeObject/108?MtRid=216584
的页面。我想像这样路由它:http://localhost/Object/ChangeObject
。 如何为此编写路线?
I have an asp.net mvc 2 application. I get a page with the url http://localhost/Object/ChangeObject/108?MtRid=216584
. I want to route it like this: http://localhost/Object/ChangeObject
.
How to write a route for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有不止一种方法可以做到这一点:
尝试修改“Global.asax”的方法“application_beginrequest”每次请求时都会调用此方法制作到网站。
看看这个示例< /p>
There are more than one way to do this:
Try to modify the methode "application_beginrequest" of "Global.asax" This method is called every time some request is made to the website.
Take a look at this example
URL Routing - By adding custom URL Route mapping rules before the default one as described in this article
试试这个
try this