What are some alternatives to RedirectToAction?


What are some alternatives to RedirectToAction?



On my HomeController I have an index action which redirects to the index action of the CustomerController via the RedirectToAction method. In this instance I don't like how RedirectToAction modifies the URL showing mysite.com/Customer. Are there some alternative mechanisms to performing a redirection that will allow me to still leverage the index action from the CustomerController?

public RedirectToRouteResult Index() {     return RedirectToAction("Index", "Customer"); } 



Jquery datepicker showing previous date in MVC

1:



window.location.href duplicate url address
As I understood it, RedirectToAction uses a reverse lookup on the routing table to generate its URL.


asp.net mvc c# javascript web.config
So if you've told the Routing module that you want to map "/Customer/Index" to Controller Customer and Action Index then RedirectToAction will take your Index and Customer arguments and convert them to "/Customer/Index"..
How do I specify error member key in ASP.NET MVC CustomValidation?
So if you want to change the behaviour of RedirectToAction you simply need to change your routing rules..
MVC HandleError attribute not working on Controller


What is the elegant solution for unrelated views in MVC web frameworks?


64 out of 100 based on 59 user ratings 534 reviews