title: Webmethod does not fire
body: <p>I download a source code, and I tried it in Visual Studio 2013, and it didn't work, but it works when I use Visual Studio 2010, which I think there is a trick in ASP.Net 4.5 that I don't know about. Here is the code:</p>
  
  <pre><code>function Load(Skip, Take) {
              $('#divPostsLoader').html('&lt;img src="../ProgressBar/ajax-loader.gif"&gt;');
  
              //send a query to server side to present new content
              $.ajax({
                  type: "POST",
                  url: "/Grid/LoadImages",
                  data: "{ Skip:" + Skip + ", Take:" + Take + " }",
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  success: function (data) {                        
                      if (data != "") {
                          $('.thumb').append(data.d);
                      }
                      $('#divPostsLoader').empty();
                  }
              })
  
          };
  </code></pre>
  
  <p>And this is the Webmethod that never run:</p>
  
  <pre><code>[WebMethod(EnableSession = true)]
  [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
  public static string LoadImages(int Skip, int Take)
  {
      System.Threading.Thread.Sleep(2000);
      StringBuilder GetImages = new StringBuilder();
      string Imagespath = HttpContext.Current.Server.MapPath("~/Images/");
      string SitePath = HttpContext.Current.Server.MapPath("~");
      var Files = (from file in Directory.GetFiles(Imagespath) select new { image = file.Replace(SitePath, "") }).Skip(Skip).Take(Take);
      foreach (var file in Files)
      {
          var imageSrc = file.image.Replace("\\","/").Substring(1); //Remove First '/' from image path
          GetImages.AppendFormat("&lt;a&gt;");
          GetImages.AppendFormat("&lt;li&gt;");
          GetImages.AppendFormat(string.Format("&lt;img src='{0}'/&gt;", imageSrc));
          GetImages.AppendFormat("&lt;/li&gt;");
          GetImages.AppendFormat("&lt;/a&gt;");
  
  
      }
      return GetImages.ToString();
  }
  </code></pre>
  
  <p>Any suggestion?</p>
  
  <p>Thanks.</p>