I have 3 html anchor tags.
depending on what link is clicked, i want to render the same view, but pointing to a different controller action.
How would i render the partial view and point the view to a different action on the same controller.
I have 3 html anchor tags.
depending on what link is clicked, i want to render the same view, but pointing to a different controller action.
How would i render the partial view and point the view to a different action on the same controller.
Use RenderAction()
.
@Html.RenderAction("Details", "User", new {id = Model.Id})
Some help about how to render partial views.
This post on StackOverflow explains the difference between Html.Action
and Html.RenderAction
, that may interest you.
UPDATE:
For doing this in JavaScript I redirect you to this question: How to call Html.RenderAction()
with parameters declarated in jscript?