So I've been stuck on this one for some time and am fairly new to using AJAX, the issue I am having is with the below AJAX when I set a break point on the C# method it is supposed to call it is never reached and no errors are displayed.
The function getCheckBoxes
is being called and executed as I stepped through what is happening with FireBug.
The second part will be the C# method I am attempting to execute with the AJAX, I got rid of the code inside as it is not even reaching it so it cannot be the problem. It is contained in TestScriptResultsController
. I have tried with both POST
and GET
types. Any help would be appreciated.
getCheckBoxes = function getCheckBoxes () {
//var firstDate = '@Model.FirstDate';
//var lastDate = '@Model.LastDate';
var fDateChanged = $("#FirstDate").datepicker('getDate');
var lDateChanged = $("#LastDate").datepicker('getDate');
var platformConfig = '@Model.PlatformConfigSelected';
var triggered = '@Model.TriggeredSelected';
$.ajax({
url: '@Url.Action("BranchCheckBoxes", "TestScriptResults")',
type: 'POST',
data: { fDateChanged: firstDate, lDateChanged: lastDate, platformConfig: platformConfig, triggered: triggered },
success: function (data) { $('#checkBoxes').html(data); }
});
}
The controller action :
public ActionResult BranchCheckBoxes(DateTime firstDate, DateTime lastDate, string platformConfig, string triggered)
{
return PartialView(trs);
}