Why in ASP.NET MVC is it when I use a:
return this.RedirectToAction("Index", "Page", new { pageKey = "test/ho/hum"})
or using the MVCContrib extension:
return this.RedirectToAction<PageController>(c => c.Index("test/ho/hum"))
formats my return URL as:
http://localhost:8882/?pageKey=test%2Fho%2Fhum
and not:
http://localhost:8882/test/ho/hum
The latter is the usual way my route is accessible, the querystring’d approach functions but reveals pageKey and is not desirable. FYI I have a catch-all route setup as {*pageKey} pointing to Index() on PageController.
Any ideas why RedirectToAction would format like that?
In your Global.asax.cs file, try to add the following routing info:
you may be able to get what you expect. However, this might create a host of bugs in your application. So used with caution.