title: RuntimeError using ASP's PageMethods
body: <p>code in my aspx is like: </p>
  
  <pre><code>&lt;%@ Import Namespace="System.Configuration" %&gt;
  &lt;%@ Import Namespace="System.Text.RegularExpressions" %&gt;
  &lt;%@ Import Namespace="System.Text" %&gt;
  &lt;%@ Import Namespace="System.Net.Mail" %&gt;
  &lt;%@ Import Namespace="System.Net" %&gt;
  &lt;%@ Import Namespace="System.Text" %&gt;
  &lt;%@ Import Namespace="System.Web.Services" %&gt;
  &lt;%@ Import Namespace="System.Web" %&gt;
  
  &lt;script type="text/javascript"&gt;
  
      var validate = function() {
          PageMethods.Send_Mail(OnSuccess, OnFailure);
      };
  
      function OnSuccess(result) {
          alert(result);
      };
  
      function OnFailure(error) {
          alert(error);
      };
  
  &lt;/script&gt;
  
  &lt;script runat="server"&gt;
  
      [System.Web.Services.WebMethod]
      public static String Send_Mail()
      {   
         //do Something
      }
  &lt;/script&gt;
  
  &lt;body&gt;
  &lt;form&gt;
  &lt;asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True"&gt;&lt;/asp:ScriptManager&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I get an RuntimeError because of the static modifier in "public static String..", when I remove static the page is shown correctly but Send_Mail() is never called. (surprisingly..)</p>
  
  <p>I guess System.Web.Services.WebMethod is not imported correctly,
  so I tried to find out how to / if i need to add assembly in web.config, unfortunately I couldn't find an example how to add it to web.config correctly.</p>
  
  <p>Any idea?</p>
  
  <p>Thank you in Advance.</p>