User-195907812 posted
Hi,
I have the following code that works fine:
var obj = {};
obj.vara = $.trim("1");
obj.varb = $.trim("2");
$.ajax({
url: "/example/Update",
type: "GET",
data: obj,
contentType: "application/json; charset=utf-8",
dataType: "json",
failure: function (response) {
//alert(response.d);
}
});
[HttpGet]
public void Update(string vara, string varb)
{
string test = vara;
}
However, I can't get this to work with an array:
var obj = {};
obj.vara = $.trim("1");
obj.varb = JSON.stringify(mystores);
$.ajax({
url: "/example/Update",
type: "GET",
data: obj,
contentType: "application/json; charset=utf-8",
dataType: "json",
failure: function (response) {
//alert(response.d);
}
});
[HttpGet]
public void Update(string vara, string[] varb)
{
string test = vara;
}
Something is stopping the call to the controller, what am I doing wrong?