Click here to Skip to main content
Rate this: bad
good
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 3:09am

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

  Print Answers RSS
0 OriginalGriff 5,380
1 Sergey Alexandrovich Kryukov 4,693
2 Peter Leow 2,939
3 DamithSL 2,465
4 Maciej Los 2,230


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