Ajax use case

Foreground method:

var senddata = { SiteGroupID: nodeId };
$.ajax({
type: "Post",//here is the http type //contentType:"application/json",//here sets the data type url
sent to the server : " CheckSiteGroup ", data: senddata,//Return a parameter dataType: "json",//Return data type success: function (dataResult) { debugger; if (dataResult) { splitter.ajaxRequest("#rightpane", "/ ComplaintRegistration/GoodEnginRegistionAdd?rd=" + Math.random(), { SiteGroupID: nodeId }); } else { alert("Registration is only allowed for completed projects"); } }, error: function () { debugger; } } );















Background method:

public ActionResult CheckSiteGroup(Guid SiteGroupID)
{
var result = false;
var siteGroup = _serviceSiteGroup.GetSiteGroupById(SiteGroupID);
if(siteGroup.EngineeringState == SiteGroupState.已完工)
{
result = true;
}
return AjaxResult(result, result);
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324902686&siteId=291194637