Click here to Skip to main content
12,068,967 members (65,099 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET Ajax jQuery
i m using jquery ajax to get data from an asp.net back end method like this:

$.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:

[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 23-Nov-12 4:09am

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160208.1 | Last Updated 23 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100