views:

41

answers:

3

My method looks like:

public static RedirectToResult(Controller controller, ...)
{

}

when I do:

controller.

I don't see RedirectToAction, how come?

I get RedirectToAction from within the controller's action, but not when I pass the controller as a parameter to another classes method. Why? really confused!

+1  A: 

If you're looking for an extension method you need the 'this' keyword before the type.

    public static ActionResult RedirectToResult(this Controller controller)
    {

    }

Hope this helps

WestDiscGolf
thanks, but not looking for an extension method.
Blankman
You also need "using Namespace.Where.Extension.Method.Declared;"
queen3
A: 

You could try out T4MVC. It will definitely help in making strongly typed Url helpers.

Chandam
+1  A: 

RedirectToAction is a protected function. You can only call it from inside the controller class.

dotjoe