views:

311

answers:

1

Is it possible to return a 307 Temporary Redirect from a controller in ASP.NET MVC?

I sometimes need to re-POST the values submitted from one form to another URI.

Using JavaScript to do the selection on the client side (thereby bypassing this issue) is not an option.

Redirecting via a GET is not an option as posted data includes an 8k string which is likely to mean that the URI would be too long for some (many?) browsers.

Is this even possible?

+2  A: 

Take a look at the following article - you can use the same technique for 307:

301 Redirects

FinnNk
I need to *sometimes* make the redirects based on the data that's passed. Accessing the model (where the logic is) from the routehandler seems wrong. Having [a copy of] the logic in the routehandler seems even worse.
Matt Lacey
Using a RouteHandler seems like a nice way to solve this kind of problem though. - Just not when there's logic involved.
Matt Lacey
You could create a different action result in which case - again here's an example that you can modify:http://www.stum.de/2008/10/22/permanentredirectresult/
FinnNk
I've ended up doing some redesign to avoid this whole issue. Some great solutions though. Thanks FinnNk
Matt Lacey