I’m trying to pass parameters to my static web method (which is in an asp.net page). I’m trying to pass the ‘test1’ param with a value of ‘myvalue’. Any ideas on what I am doing wrong?
$.ajax({ type: 'POST', url: 'WebForm1.aspx/WebMethod1', data: {'test1': 'myvalue'}, contentType: 'application/json; charset=utf-8', dataType: 'json', success: function(msg) { alert(msg.d); } });
my ‘data’ section was wrong. it needs to be ‘{‘test1′:’myvalue’}’