The project continues . .
I have a form that I'm serializing with the jquery form plugin. Works great.
I am then using the jquery ajax feature to post to an asp.net web method so that each form element can be inserted into a database.
My issue is this, how do I loop through each of the request.form params that is sent via ajax in the asp.net web method. If I use a standard Request.Form("") I receive an error. Here is my code.
var queryString = $('input').fieldSerialize();
$.ajax({
type: "POST",
url: "Detail.aspx/doPostTest",
data: "{ 'txtQuery': '" + queryString + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
var products = eval(data.d);
console.log(products);
}
});
Code behind
<System.Web.Services.WebMethod()> _
Public Shared Function doPostTest(ByVal txtQuery As String) As String
'Grab Request Form variables
Request.Form("txtMember")
End Function
The error I receive on the server side is the following:
Cannot refer to an instance member of a class from within a shared method or shared member . . etc.
Thanks in advance.