$('#btnsubmit').bind("click", function () {
var m = [];
$('#ddlPageMaster option').each(function (i, j) {
if ($(j).is(':selected')) {
m.push({ RolePageID: 0, RoleID: $('#ddlroleMaster').val(), PageID: $(j).val(), Active: $("input[name='rb']:checked").val() == 1 ? true : false });
}
});
$.ajax({
url: "@Url.Action("Save")",
type: "post",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: "{ 'objBOAdmin': " + JSON.stringify(m) + "}",
success: function ()
{
alert('Data saved.');
}
});
});
c# code
public void Save(List<BOAdmin> objBOAdmin)
{
obBLAdmin.SaveRoleMaintenance(objBOAdmin);
}
var m = [];
$('#ddlPageMaster option').each(function (i, j) {
if ($(j).is(':selected')) {
m.push({ RolePageID: 0, RoleID: $('#ddlroleMaster').val(), PageID: $(j).val(), Active: $("input[name='rb']:checked").val() == 1 ? true : false });
}
});
$.ajax({
url: "@Url.Action("Save")",
type: "post",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: "{ 'objBOAdmin': " + JSON.stringify(m) + "}",
success: function ()
{
alert('Data saved.');
}
});
});
c# code
public void Save(List<BOAdmin> objBOAdmin)
{
obBLAdmin.SaveRoleMaintenance(objBOAdmin);
}
No comments:
Post a Comment