title: Calling a c# method trough Ajax without using static methods
body: <p>I am doing a website where I have to use ajax and was wondering if there is a way to call a method from the server side with out setting the method to static. I researched this but every example I found has the method set as static and was wondering if you could this with using static here is my code </p>
  
  <p>Ajax Code:</p>
  
  <pre><code>function GetAddColour(id, Name) {
  
      var dataValue = { "id": id, "Name": Name }
  
      $.ajax({
          url: "AddColour.aspx/btnAddColour",
          type: "POST",
          dataType: "json",
          data: dataValue,
          contentType: "application/json; charset=utf-8",
          success: function (msg) {
              alert("Success");
          },
          error: function (e) {
              alert(JSON.stringify(e));
          }
      });
  }
  </code></pre>
  
  <p>The C# code:</p>
  
  <pre><code>[WebMethod]
  public static void btnAddColour(int id, string Name)
  {
      //do things to add colour
  }
  </code></pre>
  
  <p>Is there a way to this without static method and also I cannot use update panels.</p>