MVC controller method is not being called from the ajax i have declared. PFB the code snippet C# Controller:
public ActionResult Checkfunction(string ReqID, string AssociateId, string AssetId)
{
MyDetails obj = new MyDetails();
List<string> Lst = new List<string>();
Lst = obj.Check(AssociateId, AssetId, ReqID);
return this.Json(Lst, "text/json");
}
Javascript code (ajax call): refering details controller, and webmethod Checkfunction
$.ajax({
type: 'GET',
cache: false,
url: '@Url.Action("Details/Checkfunction")',
data: { 'ReqID': RequestId, 'AssociateId': AssociateID, 'AssetId': Host_Name },
contentType: "application/json",
success: function (data) {
debugger;
if (data.length > 0) {
ViewModel.REQUESTID() = data[0];
ViewModel.FLAG() = '1';
}
else {
debugger;
ViewModel.FLAG() = '0';
ViewModel.REQUESTID() = '';
}
if (ViewModel.REQUESTID() != '' || ViewModel.REQUESTID() != null) {
debugger;
ViewModel.REQID() = RequestId;
}
},
error: function (error) {
alert("error");
}
});
PhoenixInbox/CheckMSDNRemap, but your method isCheckfunction? That would be a good starting pointurl: '/PhoenixInbox/Checkfunction'