ScriptReference 顺序在运行时是否始终保持不变?
我过去曾被 Page.RegisterClientScriptBlock
所困扰,在糟糕的旧 .Net 1.1 时代,注册的 JS 没有以稳定的顺序从一台机器发送到另一台机器。 现在,我正在编写一组使用
来引用 JS 的用户控件,尽管到目前为止我还没有遇到任何问题 - 顺序似乎总是保守的在
标签之间 - 我对此感到有点害羞。 MSDN 似乎对这个主题保持沉默,并且各种博主似乎都表明排序在 .Net 2.0+ 中是稳定的,但我还没有找到任何明确的参考。
有吗? 我在开发机器上观察到的脚本的包含顺序是否保证是我在 web 应用程序运行的所有其他上下文中看到的顺序?
I've been bitten in the past by Page.RegisterClientScriptBlock
-registered JS not being emitted in a stable order from machine to machine in the bad old .Net 1.1 days. Now, I'm writing a set of user controls that use <asp:ScriptManager/>
to reference JS, and although I haven't had any problems so far - order always seems to be conserved between <asp:ScriptReference>
tags - I'm feeling a bit shy about it. MSDN seems silent on the topic, and various bloggers seem to indicate ordering is stable in .Net 2.0+, but I haven't found any definitive reference.
Does one exist? Is the order of inclusion of scripts I observe on my development machine guaranteed to be the one I'll see in all other contexts the webapp runs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
进一步的分析得出的结论是,答案是,至少在我特定的生产和开发环境中是这样。
Further analysis concludes that the answer is that they are, at least in my particular production and development environments.