Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ActionPermission2
- {
- public int ID = 0;
- public int FKMenuID = 0;
- public string ActionName = "";
- public string Allowed = "";
- public int PermissionType = 0;
- public int PermissionTypeID = 0;
- }
- public ActionResult UpdateModel2(List<ActionPermission2> menuPermissionsModel)
- {
- return Json(true, JsonRequestBehavior.AllowGet);
- }
- public ActionResult UpdateModelSA(string[] menuPermissionsModel)
- {
- return Json(true, JsonRequestBehavior.AllowGet);
- }
- $('input[type=checkbox]').each(function ()
- {
- var datarow = {
- "ID": pId,
- "FKMenuID": mId,
- "ActionName": actionName,
- "Allowed": checked,
- "PermissionType": "",
- "PermissionTypeID": ptId
- };
- jsonObj.push(datarow);
- }
- });
- $.ajax({
- type: "POST",
- //url: "@Url.Action("Update")", //string[] menuPermissionsModel
- url: "@Url.Action("UpdateModel2")", //List<ActionPermission2> menuPermissionsModel
- //url: "@Url.Action("UpdateModelSA2")", //List<string> menuPermissionsModel
- data: JSON.stringify({ 'menuPermissionsModel': jArray }),
- traditional: true,
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- success: function (data)
- {
- alert('data: ' + data);
- },
- error: function (data)
- {
- alert("error");
- console.log(data);
- }
- });
Add Comment
Please, Sign In to add comment