Reputation: 5480
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.
Upvotes: 1
Views: 217
Reputation: 1068
@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.
Upvotes: 1
Reputation: 60493
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>")
Upvotes: 1