I have a array of string myArray[] in my jQuery the value is generated dynamically. I also have a method in my code behind that has string[] myArray.
I am using the following code in my jQuery
$.ajax({
type: "POST",
url: "myurl/MyMethod",
data: "{'strArray' :" + myArray + ", 'id':" + x + "}",
dataType: "json",
success: function(response){
// DO SOME STUFF WITH THE RESPONSE...
}
});
I have the following in my code behind
[WebMethod]
public static bool MyMethod(string[] strArray, int id)
{
// DO SOME STUFF WITH THE PARAMETERS
}
Now the issue is the ajax is not calling MyMethod. Any points…
Thanks in advance…
issue resolved…
the array of strings from jQuery can be read as a whole string at the code behind. example:
will be
in the serverside code