I have a webmethod like this:
[WebMethod(EnableSession = true)]
public string testMethod(string param1, string param2="default value")
{
.......
}
I am trying to callthis method using jquery omitting the optional parameter, and the webmethod doesn't get hit.
$.ajax({
type: "POST",
url: url,
data: { "param1": "value1" }
}).complete(function (data) {....});
I works only when I pass the second parameter also. Is there any way to solve this ?