Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i m using jquery ajax to get data from an asp.net back end method like this:

JavaScript
$.ajax({
        cache: false,
        type: "POST",
        url: '<%= Page.ResolveUrl("~/Live/Live.aspx/GetViews") %>',
        content: "json",
        contentType: "application/json; charset=utf-8",
        data: "{ 'Altid' : '" + GetAltId() + "' }",
        success: function (msg) {
            $("#backEndCount").text(msg.d);
        },
        fail: function (msg) {
            $("#backEndCount").text(msg.d);
        }
    });


and the back end method:

C#
[WebMethod]
public static string GetViews(int Altid)
{
    return Live.count(Altid);
}


this call works fine locally, but on the remote service i get the page html as a response instead of the normal response which is the "d".

what is the problem, thanks.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900