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>")
Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.