Ajax Code
Controller Code
$('#btnSave').click(function () {var name = $('#txtname').val();var fname = $('#txtfname').val();
$.ajax({url: "/Home/SaveRecord",data: { 'Name' : name, 'Fname' : fname },type: "post",cache: false,success: function (Status) {alert("Save Successfully");},error: function (status) {alert("Saving failed");}});});
Controller Code
[HttpPost]
public ActionResult SaveRecord(string Name, string Fname){
}
No comments:
Post a Comment