title: Send form serialize to asp.net webmethod
body: <p>The project continues . . </p>
  
  <p>I have a form that I'm serializing with the jquery form plugin. Works great. </p>
  
  <p>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. </p>
  
  <p>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. </p>
  
  <pre><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></pre>
  
  <p><strong>Code behind</strong></p>
  
  <pre><code>&lt;System.Web.Services.WebMethod()&gt; _
  Public Shared Function doPostTest(ByVal txtQuery As String) As String
  
      'Grab Request Form variables
      Request.Form("txtMember")
  End Function
  </code></pre>
  
  <p>The error I receive on the server side is the following:</p>
  
  <blockquote>
    <p>Cannot refer to an instance member of
    a class from within a shared method or
    shared member . . etc.</p>
  </blockquote>
  
  <p>Thanks in advance.</p>