Asp.net Ajax,有时会挂起
我在我的项目中使用 ASP.net Ajax。 并使用Session进行状态管理。
在某些代码中,我有一些模态弹出窗口,其中包含 UC 并执行一些操作。
如果我使用 UpdatePanel ,有时,当我打开弹出窗口时,很长一段时间都会显示进度条并且不执行任何操作。 如果我刷新页面它将正常工作。 另外,如果我删除 UpdatePanel,所有方法都可以正常工作。
在我有多个弹出窗口(或我在更新面板下运行的任何方法)的页面上,我遇到了这个问题。
什么问题? 我该如何解决这个问题?
I use ASP.net Ajax on my project. and using Session for state management.
in some piece of code , I have some modalpop up , that contain UCs and do some things.
If I use UpdatePanel , sometimes, when I open popup, for a long time progress bar shows and dont do any things. if I refresh page it will work correctly.
Also If I remove the UpdatePanel all methods work perfectly.
on pages that I have more than one popup( or any method that I run under update panel) I have this problem.
What was wrong? and how can I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您应该做的第一件事是获取 Fiddler 并查找任何未完成的请求。
First thing you should do is get Fiddler and look for any outstanding requests.
您使用什么类型的浏览器? 有时 Google Chrome 会像我的个人网站一样遇到这个问题。 不幸的是,我也不知道发生了什么。
What type of browser are you using? Sometimes Google Chrome suffer from this problem like my personal website. Unfortunately, I've no idea what's going on,too.
检查 Firebug,在控制台模式下,您可以查看发送了哪些 http 请求,以及它们是否已经收到响应(并查看它的回应)。 这是开始调试与 Ajax 相关的所有内容的好地方。
Check with Firebug, in console mode you can see what http requests are sent, and if they already got a response (and see its response). It's a good place to start debugging everything that has to do with Ajax.
我发现,当您实际上没有支持 IPv6 的网络时,启用 IPv6 有时会导致像这样的延迟,而系统会尝试 IPv6(最终超时,然后恢复为 IPv4)。
I've found that leaving IPv6 enabled when you don't actually have a network which supports it can sometimes introduce lag like this, while the system tries IPv6 (and eventually times out, then reverting to IPv4).
有关更多信息,我在OnInit方法中动态加载UC,因此在每次回帖时,UC都会再次加载,之前当我加载UC静态时,我没有像现在这样的问题。
我还使用 ModalUpdateProgress ,这是 Progressbar 的第三方开源控件
for more information , I load UC dynamiclly on page in OnInit method, therefore on every post back , UC load again , before when I load UC static , I have not this problem such as now.
Also I use ModalUpdateProgress , that was a third party and open source control for Progressbar