Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HI,

controller method is not getting called.

View:
onclick of button I am submitting the page but before submitting I have to check validation like this:

<input type="submit" value="Initiate" id="btnInitiate" style="width: 80px; margin-left: 40px"
/>


function submitForm(e) {

debugger;
$.ajax({
url: '/VisaInformation/ValidateDependentEmployees',
type: 'POST',
dataType: 'json',
data: {
empNos: '194838',
Detailid: 19786,
DependentAvailibity: 0
},
success: function (data) {
debugger;
alert("success");
},
error: function () {
debugger;
alert('error');
}
});
}





Controller:

[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
public JsonResult ValidateDependentEmployees(string empNos, int Detailid, bool DependentAvailibity)
{
.....
return this.Json(new { Success = "E" }, JsonRequestBehavior.AllowGet);

}

This Controller method is not getting called.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900