我有 3 个 html 锚标签。
根据单击的链接,我想呈现相同的视图,但指向不同的控制器操作。
我将如何渲染局部视图并将视图指向同一控制器上的不同操作。
我有 3 个 html 锚标签。
根据单击的链接,我想呈现相同的视图,但指向不同的控制器操作。
我将如何渲染局部视图并将视图指向同一控制器上的不同操作。
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?