Asp.Net(C#) Jquery Ajax with WebMethod In Public Method Call

Posted by oraclee on Stack Overflow See other posts from Stack Overflow or by oraclee
Published on 2010-03-25T14:11:51Z Indexed on 2010/03/25 14:13 UTC
Read the original article Hit count: 442

Filed under:
|

Hi All;

Aspx Page: $(document).ready(function() {

            $("#btnn").click(function() {
                $.ajax({
                    type: "POST",
                    url: "TestPage.aspx/emp",
                    data: "{}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(msg) {
                    }
                });
            });
        });

CodeBehind:

public void grdload()
    {
        GridView1.DataSource = GetEmployee("Select * from Employee");
        GridView1.DataBind();
    }

[WebMethod]
    public static void emp()
    {
        TestPage re = new TestPage();
        re.grdload();
    }

I Can't Gridview Data Load ? How To Make GridView Data Load?

Thank You

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about ASP.NET