Manoj Maharana

Manoj Maharana

  • NA
  • 362
  • 126.8k

how can i pass a string variable in json

Aug 30 2016 2:18 AM
When i got string value in obj then  return false calls and output getting null in controller...so how to solve this??
how can i pass a string variable in json?? 
Here is the code:
 
 
function EditRow(obj) {
debugger
//var jSon = JSON.stringify(obj);
//data: { "LocationId": obj },
$.ajax({
url: "/TLocation/EditLocation/",
type: "GET",
cache: true,
//async: true,
//data: JSON.stringify({ LocationId: obj }),
//data: { "LocationId": obj },
data: { LocationId: JSON.stringify(obj) },
success: function (result) {
$("#EditLocation").html(result);
},
error: function (result) { alert(''); }
});
return false;
}
obj="Test"

Answers (3)