Pass data from view to controller in JSON format- MVC Application

View jquery function Save() { $.ajax ({ url: "@(Url.Action("SaveMember", "Members"))", data: { name: $("#MemberName").val(),designation: $("#ddlDesignation option:selected").val() }, contentType: "application/json; charset=utf-8", type: 'GET', dataType: "json", success: function (result) { alert("Record saved successfully."); }, error: function () { alert("Something went wrong, please try again"); } }); } html <div class="col-sm-4 tb-font"> @Html.Label("name", "Member Name", new { style... Continue Reading →

Create a free website or blog at WordPress.com.

Up ↑

Design a site like this with WordPress.com
Get started