Monday, April 29, 2013

Simple jQuery PageMethod call


Simple Ajax call :

   function aa() {
            $.ajax({
                url: "Default.aspx/GetName",
                type: "POST",
                contentType: "application/json;",
                success: function(result) {
                alert(result.d);
                 }
            });
        }

1.  Sequence is not important
2.  Not all parameters are required.

using System.Web.Services;
    [WebMethod]
    public static string GetName()
    {
        return "aabb";
    }

No comments:

Post a Comment