当设置为 false 时,ScriptManager 不支持 LoadScriptsBeforeUI 属性
我在使用 IE 7 时遇到了一些性能问题,即在加载脚本时页面在渲染期间暂停,这有时需要长达 5 秒的时间,并且在用户等待时留下空白屏幕。
经过排除过程后,我推断这是因为 asp.net ScriptManager 类发出的脚本,通过转储 html 并使用底部的脚本测试同一页面,问题得到解决(很好地解决了用户体验得到了极大的改善,因为用户现在可以看到一个渲染良好的页面而不是一个空白屏幕)
所以我想将发出的脚本移动到页面底部并查看将 ScriptManager.LoadScriptsBeforeUI 设置为 false 以实现不幸的是,将此属性设置为 false 对于脚本引用在标记中的呈现位置没有影响。
有没有人遇到过这个问题,有人可以提出解决方法吗?
非常感谢
尼克
I am having some performance problems with IE 7, whereby the page pauses during rendering while scripts are loaded, this is at times taking up to 5 seconds and leaves the user with a blank screen while he/she waits.
After a process of elimination I have deduced this is because of the scripts emitted by the asp.net ScriptManager class, by dumping the html and testing the same page with the scripts at the bottom, the problem is resolved (well to the extent that the user experience is greatly improved as the user now has a nicely rendered page to look at rather than a blank screen)
So I want to move the emitted scripts to the bottom of the page and looked at setting ScriptManager.LoadScriptsBeforeUI to false in order to achieve this, unfortunately setting this property to false has no effect on where the script references are rendered in the mark-up.
Has anyone encountered this problem, and can anyone suggest a way around it?
Many thanks
Nick
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我随后发现 LoadScriptsBeforeUI 属性仅与手动添加到脚本管理器的脚本相关。我在脚本管理器中包含了一个服务引用,并希望该引用也能在表单末尾呈现。事实并非如此。
尼克 - 感谢您的回复,我将看看 dynaTrace。
I have subsequently discovered that the LoadScriptsBeforeUI property is only relevant for scripts manually added to the script manager. I was including a service reference with scripts manager and expecting this reference to also be rendered at the end of the form. This is not the case.
Nick - thanks for your response I will be taking a look at dynaTrace.
我建议您使用 dynaTrade AJAX 版。完全免费且专门针对 IE。您可以获得完整的时间表以及占用您时间或 CPU 的详细信息。如果它是一个挂起的 javascript 函数,则加载脚本时间......无论如何,这将为您节省大量时间。
只需加载 dynaTrace,启动会话,转到麻烦的 url,然后分析结果。该页面上的演示视频为您提供了演练。
我用它来弄清楚为什么在我的项目中 IE 中有些东西会出现问题,它是一个很好的工具,而且免费部分也没有什么坏处。
I suggest you grab dynaTrade AJAX Edition. Completely free and specifically for IE. You can get a full timeline and breakdown of what's eating your time or CPU. If it's a hung javascript function, load time on a script...whatever, this will save you loads of time.
Just load dynaTrace, start a session, go to the troublesome url and then analyze the results. The demo video on that page gives you a walk-through.
I've used this to figure out why some things give trouble in IE in my projects, it's been an excellent tool, and the free part doesn't hurt either.