raj kadam

raj kadam

  • NA
  • 92
  • 7.5k

Sending Json data to Model in MVC

Oct 29 2015 8:27 AM
this is my json code for sending value but it not getting at controller end..
$("#submitt").click(function ()
{
var name = $("#txtName").val();
var city = $("#txtCity").val();
var data = { 'name': name, 'city': city };
var obj = JSON.stringify(data);
$.ajax(
{
url: '/Mate/Create',
type: 'POST',
dataType: 'json',
data: {},
contentType: 'application/json; charset=utf-8',
success: function (obj)
{
alert(obj.d);
$("#content").html("Sending..");
}
})
});

Answers (2)