Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi we are using jquery to sending ajax requests but its returns page's content everytime.
we are using this code.
Server using .NET Framework version 2

JavaScript
$.ajax({
    type: "POST",
    url: "ajaxPage.aspx/testMethod",
    data: "{test:'test'}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (result) {
        $("#span_result").html(result.d).fadeIn();
    },
    error: function (msg) {
         $("#span_result").hide();
    }
}); 


C#
//ajaxPage.aspx.cs
[System.Web.Services.WebMethod]
public static string testMethod(string test)
{
     return test;
}
Posted
Updated 16-Aug-11 1:52am
v2

1 solution

Have you updated the ScriptManager?

<asp:scriptmanager id="ScriptManager1" runat="server" enablepagemethods="true" xmlns:asp="#unknown" />
 
Share this answer
 

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