I am sending an ajax call on on a button click to load a partial view in Kendo Modal window. In dev mode it is doing everything fine as expected but giving me a 404 error in live.
Following is my Ajax call
$('.add_page').click(function (e) {
e.preventDefault();
$.ajax({
url: '../Page/AddEditPage',
type: 'Get',
accepts: 'text/html',
context: self,
success: self.addEditPageWindowCallBack,
error: function () { toastr.error('Error: Something went wrong'); },
complete: function () { }
});
});
Following is the Ajax success method
addEditPageWindowCallBack: function (html, textStatus, jqXHR) {
var model = $('#AddEditPageModelWindow').data('kendoWindow');
if (model === undefined) {
model = $('#AddEditPageModelWindowLayout').data('kendoWindow');
}
model.content(html);
model.center();
model.open();
},
My Controller action method is as follow
public ActionResult AddEditPage(int Id = 0)
{
var pageId = Id;
var pageViewModel = new PageViewModel();
if(pageId == 0)
{
pageViewModel = new PageViewModel
{
Page = new Page(),
};
pageViewModel.Page.CreatedBy = User.Identity.GetUserId();
}
else
{
var pageData = pageService.GetPageByPageId(pageId);
pageViewModel = new PageViewModel
{
Page = pageData,
};
}
return PartialView("~/Views/Shared/Page/_AddEditPage.cshtml", pageViewModel);
}
Initially, I was returning partial view as follow
return PartialView("Page/_AddEditPage", pageViewModel);
That i have changed with the following but still no effect
return PartialView("~/Views/Shared/Page/_AddEditPage.cshtml", pageViewModel);
I am trying to find a resolution to this problem. Any idea either of resolving this issue or if there is any way of catching the exact error in live environment will really help.
Following is the Network screen shot of error