Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi,

I am working on ajax-webmethod(using json) to save data in Db and select it when needed. now whenever I call the webmethod the time it processes the method the whole page is hanged and nothing can be done with the page.

I want to enable every thing when the web method is called from ajax like it show a loading image until the process executes the web method.

my code is below:
JavaScript
function getvalues(id, tab, pageNo) {
    $.ajax({
        type: "POST",
        url: "default.aspx/LoadData",
        data: "{'id':'" + id + "','tab':'" + tab + "','pageNo':'" + pageNo + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function(msg) {
            if (msg.d.length > 0) {
                var dvComment = document.getElementById("Comments");
                dvComment.innerHTML += msg.d;
            }  
        },
        async: true,
        error: function(xhr, status, error) {
            // alert(xhr.statusText);
        }
    });
}


so now when it renders the html into the DIV the whole time the page is hanged.
Posted
Updated 4-May-11 1:20am
v2

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