tags:

views:

67

answers:

1

Say I have:

public ViewResult List() {}

inside this function, I check if there is only one item in the list, if there is I'd like to redirect straight to the controller that handles the list item, otherwise I want to display the List View.

How do I do this? Simply adding a RedirectToAction doesn't work - the call is hit but VS just steps over it and tries to return the View at the bottom.

+3  A: 

You probably need to return RedirectToAction instead of just calling the RedirectToAction. Just a guess, we could be more specific if you post the code.

magnifico
That worked after changing the function return type to ActionResult, cheers!
Pete