خرید بک لینک

در سمت کنترولر یک 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>


MyPartialViewهم بارشل شما برای نمایش هست

برچسب: نویسنده: محمد رضا جوادیان تاريخ: سه شنبه 12 دی 1396 ساعت: 1:43

صفحه بندی