Is there a way in ASP.NET MVC 4 to bind route values from sources other than a placeholder in a route URL: a header or post data for example? Or are they intrinsically coupled to the URL?
Specifically, I was interested in overriding the action
route value with a value from a posted form field. That way, you could easily have different submit buttons on a page that invoked different actions on the controller by giving each a name
of action
and a value
of the action name.
I've tried setting the RouteData.Values
in an HttpModule
but that appears to be too early in the pipeline to override the action.