1

I am using ASp.NET MVC 3.

Whilst in a View, how do I redirect the User to a View that's in a different Controller altogether?

I can do: @Html.ActionLink("Go Here", "Index") but I want to direct the user to an Index view of a different Controller.

Any help is highly appreciated.

2 Answers 2

1

use another overload from ActionLink

public static MvcHtmlString ActionLink(
    this HtmlHelper htmlHelper,
    string linkText,
    string actionName,
    string controllerName
)

http://msdn.microsoft.com/en-us/library/dd505070%28v=vs.108%29

usage

@Html.ActionLink("Go Here", "Index", "<YourOtherController>")
0
1

@Html.ActionLink(string LinkText, string ActionName, String ControllerName)

There are a lot of prameters to choose from. Type @HTML.ActionLink( and they will show up. Navigate between them using the up and down button.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.