Server side method call by jquery error
<p>this way i am calling my server side code....my code as follows.</p>

<pre><code>$(function () {
    $('#btnSubmit').click(function () {

        $.ajax({
            type: "GET",
            url: "MyPage.aspx?id=201/GetData",
            data: {},
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (data) {
            }
            ,
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert(textStatus);
            }
        });
        return false;
    });
});
</code></pre>

<p>i doubt i am getting error because url is wrong url: "MyPage.aspx?id=201/GetData"</p>

<p>i think it should be url: "MyPage.aspx?id=201"</p>

<p>2) i have another question that what different type of value can be set for  dataType property of jquery ajax call.</p>

<p>dataType can be html or text? when dataType  would be html then what would be right contentType? and the same way when</p>

<p>dataType  would be text then what would be right contentType?</p>

<p>3) when dataType will be text or html then can i call my custom server side function like url: "MyPage.aspx/GetData",</p>

<p>4) when dataType will be text or html then how to return data from server side function. then can i write code like</p>

<p>when datatype is text then do i need to return like below one</p>

<pre><code>[System.Web.Services.WebMethod]
public static string GetData()
{
    return "Hello";
}

[System.Web.Services.WebMethod]
public static string GetData()
{
    response.write("Hello");
}
</code></pre>

<p>when datatype is html then do i need to return like below one</p>

<pre><code>[System.Web.Services.WebMethod]
public static string GetData()
{
    return "&lt;div&gt;Hello&lt;/div&gt;";
}

[System.Web.Services.WebMethod]
public static string GetData()
{
  response.write("&lt;div&gt;Hello&lt;/div&gt;");
}
</code></pre>

<p>do i need to set response.content type.</p>

<p>please guide in detail.......thanks</p>
