Script# and Asp.Net updatepanels compatibility

我们两清 提交于 2020-01-05 08:15:11

问题


This is a simple question, NikhilK answered to this question: "Script# doesn't support ASP.NET Ajax anymore"

Does that mean that we can't use Asp.net UpdatePanels (which need a ScriptManager) in the same page where we load mscorlib.js? Even if mscorlib is manipulating DOM elements that are not inside the updatepanel?


回答1:


When I mentioned asp.net ajax is not supported, it is primarily a two-fold statement:

  1. MSAjax assemblies allowing you to program against the msajax scripts are no longer included.
  2. There was a mode of the compiler which caused generated script to use the type system defined in msajax scripts.

Conceptually you should be able to load mscorlib.js and program using it in any page, including one using asp.net ajax (and update panels). As a heads-up you may run into one particular issue... mscorlib.js extends Array.prototype, which I don't think affects msajax scripts, but might affect some other scripts (eg. sharepoint scripts).

In the future, I plan to generate scripts differently that would not require extending Array.prototype, but that work hasn't been done yet.

So hopefully that clarifies things. If you try and run into issues, I'd love to know. I can't guarantee they'll be fixed (esp. given that even asp.net is primarily focused around jQuery rather then the old msajax scripts), but I can try helping to see if any of them have reasonable workarounds.



来源:https://stackoverflow.com/questions/7843260/script-and-asp-net-updatepanels-compatibility

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!