title: Ajax method call
body: <p>I am trying to call a simple method in my code behind using Jquery with Ajax. But I get a 404 not found exception everytime. Unfortunately this is a web forms solution. So I dont have all the perks of MVC :(</p>
  
  <p>It does get into the javascript method and gives the alert but won't go into my c# method. My previous experience of using this Jquery method is in an MVC website. Is it compatible with webforms sites?</p>
  
  <p>My Javascript is:</p>
  
  <pre><code>$(document).ready(function() {
  
                $('#btn_&lt;%=UserStuff.tag %&gt;').click(function() {                    
  
                    var value = $('#&lt;%#Eval("tag") %&gt;twink').val();
                    something(value);                    
                });
            });
  
  
            function something(theval) {
  
              alert(theval);
  
                $.ajax({
                    type: "POST",
                    url: "/Default.aspx/MyMethod?something=" + theval,
                    data: "{}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(msg) {
                        alert(msg);
                    }
                });
            }
  }
  </code></pre>
  
  <p>And my C# code is:</p>
  
  <pre><code>   public JsonResult MyMethod(string something)
  {
      JsonResult ret = new JsonResult();      
  
      return ret;
  }
  </code></pre>
  
  <p>Thanks in advance.</p>