执行Web方法时页面被挂起 [英] page hanged when web method is executes

查看:787
本文介绍了执行Web方法时页面被挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



 

我正在使用ajax-webmethod(使用json)在Db中保存数据并在需要时选择它。现在,每当我调用webmethod处理方法的时候,整个页面都被挂起,并且页面无法完成任何操作。

 

我想启用所有功能当从ajax调用web方法时,它会显示加载图像,直到进程执行web方法为止。

 

我的代码如下:

 

函数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& gt; 0){

                 var dvComment = document.getElementById(" Comments");

                       dvComment.innerHTML + = msg.d;

                  }  


            },

            async:true,

           错误:功能(xhr,状态,错误){

                  // alert(xhr.statusText);

            }¥b $ b      });

}

 



所以现在它将html渲染到DIV整个页面被挂起的时间。

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:
 
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.

推荐答案

您好

我们正在研究这个问题。可能需要一些时间才能反馈给您。

We are doing on research on this issue. It may take some time to feed back to you.

感谢您的理解。


这篇关于执行Web方法时页面被挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆