I'm learning about asp methods via ajax and...

So I tried doing the ff. from this site: <http://encosia.com/using-jquery-to-directly-call-aspnet-ajax-page-methods/>

In JS file:

```
 $(document).ready(function () {
// Add the page method call as an onclick handler for the div.
$("#Result").click(function () {
    $.ajax({
        type: "POST",
        url: "WebForm1.aspx/GetDate",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            // Replace the div's content with the page method's return.
            $("#Result").text(msg.d);
        }
    });
});

```

});

**In aspx:**

```
 <html>
<head>
<title>Calling a page method with jQuery</title>
<script type="text/javascript" src="Scripts/jquery-1.4.1.js"></script>
<script type="text/javascript" src="Scripts/JScript1.js"></script>
 </head>
  <body>
<div id="Result">Click here for the time.</div>
 </body>
 </html>

```

**In code-behind:**

```
namespace WebApplication1
 {
   public partial class WebForm1 : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    [WebMethod]
    [ScriptMethod(UseHttpGet = true)]
    public static string GetDate()
    {
        return DateTime.Now.ToString();
    }

}

```

}

When I run it on VS studio on my local PC, it works just fine; however, once the files are deployed in IIS server, it gives this error when I click on the container:

POST http:///WebForm1.aspx/GetDate 500 (Internal Server Error)

Is there something to configure in IIS? or is it code-related error?