How do I render the partial view using jquery?
We can render the partial View like this:
<% Html.RenderPartial("UserDetails"); %>
How can we do the same using jquery?
up vote
9
down vote
favorite
7
|
How do I render the partial view using jquery? We can render the partial View like this:
How can we do the same using jquery?
|
|||
|
up vote
17
down vote
|
You can't. You can, however, call a method (action) that will render the partial view for you.
where the user controller has an action named details that does:
|
||||||
|
up vote
13
down vote
accepted
|
I have used ajax load to do this:
|
||
|
up vote
2
down vote
|
You'll need to create an Action on your Controller that returns the rendered result of the "UserDetails" partial view or control. Then just use an Http Get or Post from jQuery to call the Action to get the rendered html to be displayed. |
||
|