This project is read-only.

RedirectToAction(MVC.Dinners.Details(dinner.DinnerID)): Error in documention?

Jun 21, 2013 at 3:31 PM
The documentation page contains the following code snippet in section 2.2.4:
return RedirectToAction(MVC.Dinners.Details(dinner.DinnerID));
But this code does not compile when using it inside a controller (MVC3/.NET 4.0) since the Controller.RedirectToAction expected a parameter of type string, while the Action method returns an ActionResult.

What is the correct way to redirect to an action?
Jun 21, 2013 at 4:19 PM
It's an overload that T4MVC generates in the partial class, so it should work fine as written.
Jun 22, 2013 at 12:27 AM
Ahh okay, I think I see the problem. The generated overload is STATIC. That's why it didn't compile and why I didn't see it using IntelliSense; I tried to access that method using the this. prefix. I assumed it to be an instance method, since all RedirectToAction other methods are instance methods.
Jun 22, 2013 at 12:41 AM
It's not static, it's instance. See here for an example of what it looks like.
Jun 24, 2013 at 8:14 AM
How odd. Perhaps the template didn't run. Now it does. And it works. Thanks for the feedback.