$(ajax) using webservice response

Posted by loviji on Stack Overflow See other posts from Stack Overflow or by loviji
Published on 2010-06-06T20:02:27Z Indexed on 2010/06/06 20:12 UTC
Read the original article Hit count: 286

Hello, I have a simple ajax query.

$(document).ready(function () {
        var infManipulate = true;
        var tableID=<%=TableID %>;
        var userName="<%=CurrentUserName%>";
         $.ajax({
                    type: "POST",
                    url: "../../WS/Permission.asmx/CanManipulate",
                    data: "tableID=" + tableID + "&userName=" + userName + "",
                    success: function (msg) {
              //**how can I know there method CanManipulate returned true or false?** 
                        msg;
                        debugger;
                    },
                    error: function (msg) {


                    }

                });

And simple web-method

[WebMethod]
public bool CanManipulate(int tableID, string userName)
{
    //some op.
    return prm.haveThisMatch(userName, tableID, "InfManipulate");
}

how can I know there method CanManipulate returned true or false value in $(ajax) content?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET