开发者

Account for simple url rewriting in ASP.NET MVC redirect

How would you go about redirecting in ASP.NET MVC to take into account some external URL rewriting rules.

For example:

  • What the 开发者_StackOverflow社区user enters: http://www.example.com/app/route
  • What ASP.NET MVC sees: /route
  • What I want to redirect to: http://www.example.com/app/other_route
  • What actually happens when I do a simple RedirectToAction: http://www.example.com/other_route (which doesn't exist, from the outside anyway)

This seems like it should be simple, but I'm drawing a blank.


Just use

RedirectToAction("NewAction", "Controller-Required-If-Diferent-From-Current-Controller");

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜