I work with asp.net and I have some issues.
I created partial view with error message and I want to call view using jQuery.
I have already created function in controller which returns a partial view. But I am stuck with ajax, all time I get errors.
Controller:
[HttpGet]
public ActionResult LoadPartialView()
{
return PartialView("_ErrorMessageWindow");
}
jQuery:
$.ajax({
url: "@(Url.Action('LoadPartialView'))",
type: "GET",
cache: false,
datatype: 'html',
success: function (data) {
}
});
Error:
jquery-3.3.1.min.js:2 GET https://localhost:5001/@(Url.Action('LoadPartialView'))?_=1565937416181 404 (Not Found)
Url.Actio. Correct it.Jquerycode? Is it in the.cshtmlor separate.jsfile.