I have an ajax call in my js file which calls an action method returning a partial view.
This ajax call hits the breakpoint on controller for the first time it is being called. But the next time it is not hitting the breakpoint but it still goes to the success function of ajax call and the result of the success call is the complete html of the page which also includes the layout being inherited.
Could anyone please tell me what is happening here and the possible solution to this?
The js code looks like this.
var UrlRoot.History = '@Url.Action("Action", "MyController", new { Area = "ControllerArea" })';
$.ajax({
url: UrlRoot.History,
type: 'POST',
datatype: 'json',
data: params, // params being passed(which is passed correctly at the first call)
success: function (result) {
debugger;
if (result != null) {
if (result == "Please select any row from match maker to load data!!!") {
$("#NoRecord").show();
$("#NoRecord").html('');
$("#NoRecord").html(result);
}
else {
$("#tab_1").html('');
$("#tab_1").html(result); // Fill the tab content with partial view returned from action method.
}
}
},