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)



Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 23 Nov 2012
Copyright © CodeProject, 1999-2014
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