در سمت کنترولر یک Action بدینصورت تعریف کنید
[HttpGet]public virtual ActionResult MyAction(errorMessage or viewModel)
{
retu PartialView("MyPartialView, model);
}
<script>function GetPartial() {
$.ajax({
url: "@Url.Action("MyAction", "myController")",
dataType: "html",
type: "GET",
cache: false,
contentType: 'application/json; charset=utf-8',
data: {param:value},success: function (response)
{
$("#MyPartialView").html(response);
}
});
}</script>
برچسب:
نویسنده: محمد رضا جوادیان