So serialisieren Sie das ASP.NET MVC-Formular in JSON in JqueryC#

Ein Treffpunkt für C#-Programmierer
Guest
 So serialisieren Sie das ASP.NET MVC-Formular in JSON in Jquery

Post by Guest »

Ich möchte mein ASP.NET MVC-Formular mit jQuery in JSON serialisieren und dann einige Werte wie den Wert des Eingabefelds im Backend in C# deserialisieren, kann es aber nicht in JSON serialisieren. Bitte helfen Sie mir bei diesem Problem.
Hier ist mein Code:




$(function () {
$('#btnsearch').click(function (e) {
var searchname = $('#txtsearch').val();

var form = $(this).serializeArray();

DrawTable(form);
});

function DrawTable() {
var props = [];
props.push({ name: "FirstName", value: firstname });
BindDataTable({ AllowPaging: true, ShowFilter: false, ShowEditLink: true, EmptyTableText: 'No Data Found', SortIndex: 0, SortDirection: "asc" },
"#tblCustomers",
"@Url.Action("GetAllCustomers", "Customer")",
props,
[{ name: "Id", cellClass: "alignCenter", Sortable: true, index: 0 }, { name: "FirstName" }, { name: "ABN" }, { name: "Phone" }, { name: "Email" }, { name: "Address1" }, { name: "City" }, { name: "Country" }],
[{ name: "Id", type: "anchor", title: 'customerTable', viewtitle: 'View', link: '@Url.Action("Edit", "Customer")', index: 0 }]);
}

// DrawTable(data);
//$('#myInputTextField').on('keyup', function () {
// oTable.search($(this).val()).draw();
//});
});

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post