title: Call WebMethod in C# codebehind without using a server form in ASPX page
body: <p>Due to issues with styling, and needing multiple forms on one single web page, I currently have a form that is outside of the normal form with runat=server.</p>
  
  <p>Is it possible for me to still call a WebMethod in the C# codebehind of this web page using ajax?  I want to submit the information from this form to the same connection string that I am using earlier in the page, in a different form.</p>
  
  <p>Here is my current code:</p>
  
  <pre><code>$().ready(function () {
      $("input[type=submit]").click(function () {
          handleClick();
          createJob();
      });
  });
  
  function createJob() {
  var txtTestValue = document.getElementById('jobTitle').value;
  
  $.ajax({
      // POST signals a data request
      type: "POST",
      // This directs which function in the c# code behind to use
      url: "Account/help.aspx/CreateJob",
      // The paramater pageIndex, page number we need to load, to pass to GetCustomers(int pageIndex)
      data: txtTestValue,
      // Type of data we are sending to the server (i.e. the pageIndex paramater)
      contentType: "application/json; charset=utf-8",
      // Type of data we expect back from the server (to fill into the html ultimately)
      dataType: "text",
      // If all goes smoothly to here, run the function that fills our html table
      success: OnSuccess,
      // On failure, error alert user (aka me so that I know something isn't working)
      failure: function (response) {
          alert("failure");
      },
      error: function (response) {
          alert("error");
      }
  });
  });
  </code></pre>
  
  <p>And my WebMethod in the codebehind:</p>
  
  <pre><code>[WebMethod]
  public string CreateJob()
  {
      //rest of my database code here
  }
  </code></pre>
  
  <p>Sorry for the confusion but it's doing everything right up until the ajax code, and then seems to ignore it (and returns that the ajax failed with an error).  My code is not reaching the WebMethod and any breakpoints I set in Visual Studio are not triggered in the page header.  Thanks in advance for your help!</p>