function unlockJob(jobrunid, entityId) {
$.ajax({
type: "POST",
url: '/management/redis_locks/' +jobrunid + entityId,
data: '{' + jobrunid + entityId + '}',
contentType: "application/json; charset=utf8",
dateType:"json",
body: jobrunid,
success: function () {
$("#" + jobrunid + "").append("<span style='color:green'>Unlocked Successfully</span>");
$("#button"+ jobrunid + "").hide();
}
});
}
//This is Controller method i am calling
[POST("redis_locks/{entity_id}")]
[AccessLevelAuthorizationFilter(MinimalAccessLevel = AccessLevel.Admin)]
public JsonResult UnlockJob(String JobrunId, String entityId)
{
_redisRepository.ReleaseLock(RedisKeys.JobRunner.GenericEntityLock(entityId, _cacheKeyBuilder.Prefix));
var model = true;
return Json(model, JsonRequestBehavior.AllowGet);
}
这是我调用的Javascript代码和C#代码,当我从上面的ajax函数调用时,我无法在Controller中获取值。!!