创建特定路由条目以访问区域内的控制器
我想尝试将所有购物车处理保留在 MVC2 项目中单独“区域”内的 1 个控制器内。
但是,我需要将此控制器中的 1 个操作公开给一个已经存在很长时间的 URL,并且该 URL 不包含对该区域的任何引用。
我的区域和控制器设置为处理如下所示的请求(Commerce 是区域):
http://www.abc.com/Commerce/Buy/Select
但我必须响应的 URL 是:
http://www.abc.com/quote/
是否可以创建一个一次性路由规则来处理这是给我的?我知道我可以创建一个名为“Quote”的控制器并将其放置在商务区域之外,但我宁愿使用路由。
谢谢。
I want to try and keep all my shopping cart processing within 1 controller within a separate "Area" in MVC2 project.
However, I need to expose 1 action in this controller to a URL that has been around for a long time and that URL does not include any reference to the area.
My area and controller are setup to deal with requests that look like this (Commerce is the Area):
http://www.abc.com/Commerce/Buy/Select
But the URL that I'm having to respond to is:
http://www.abc.com/quote/
Is it possible to create a one-off routing rule that would take care of this for me? I know I could create a Controller called "Quote" and sit it outside the Commerce area but I'd rather make use of routing.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你试过这个吗?
Have you tried this?
抱歉,这很简单:
Sorry, its easy as: