$("#btnSubmitRetation").on("click", function (e) {
var datatype = [];
// console.log($(".row-checkbox").length);
// console.log($(".row-checkbox:checked").length);
$(".row-checkbox").each(function (i) {
var id = $(this).attr("id");
var defaultValue = "false";
if ($(this).is(":checked")) {
defaultValue = "true";
}
dataSet = {
"key": id,
"value": defaultValue
}
datatype.push(dataSet);
});
$.ajax({
url: '@Url.Action("SaveRecordsRetention", "RecordsRetention")',
type: 'POST',
data: "jsonOfLog=" + JSON.stringify(datatype),
dataType: 'text',
success: function (result) {
}
});
Controller:
[HttpPost]
public ActionResult SaveRecordsRetention(string jsonOfLog)
{
// var convertedvalue = Newtonsoft.Json.JsonConvert.DeserializeObject
try
{
if (jsonOfLog != null)
{
List
- >>(jsonOfLog);
}
No comments:
Post a Comment