In ASP MVC3, how can execute a controller and action using a uri?
问题 How can I, when executing a controller action, take a Uri (not the one requested) and invoke the action from the controller that would have been executed had that Uri been the one that was called? I can't simply redirect to that action as I need it to happen in the same request context. 回答1: Assuming you have access to the HttpContext (and I suppose you do since you are asking) you could: var routeData = new RouteData(); // controller and action are compulsory routeData.Values["action"] =