我有一个 UserControl,它不是将标签放入其 ascx 标记文件中,而是重写其代码隐藏中的 render() 以使用 XSLT 写出从 XML 生成的 XHTML。
我想渲染一个 iframe(作为克服 IE6 的 SELECT z-index bug 的技巧),但是当我编辑 xslt 来渲染 iframe 时,ASP.NET 的 ScriptResource.axd 输出中就会出现 JavaScript 错误(但是Firefox 中没有):
Error: Sys.ArgumentNullException: Value cannot be null. Parameter name: panelsCreated[0]
我在VS2010中调试时提示的行是if (e) throw e;
$type = Sys.WebForms.PageLoadedEventArgs = function PageLoadedEventArgs(panelsUpdated, panelsCreated, dataItems) {
/// <summary locid="M:J#Sys.WebForms.PageLoadedEventArgs.#ctor">The arguments for the PageRequestManager's pageLoaded event. The pageLoaded event is raised after the DOM has been updated.</summary>
/// <param name="panelsUpdated" type="Array">An array of UpdatePanels that were updated.</param>
/// <param name="panelsCreated" type="Array">An array of UpdatePanels that were created.</param>
/// <param name="dataItems" type="Object" mayBeNull="true"></param>
var e = Function._validateParams(arguments, [
{name: "panelsUpdated", type: Array},
{name: "panelsCreated", type: Array},
{name: "dataItems", type: Object, mayBeNull: true}
]);
if (e) throw e;
Sys.WebForms.PageLoadedEventArgs.initializeBase(this);
this._panelsUpdated = panelsUpdated;
this._panelsCreated = panelsCreated;
this._dataItems = dataItems || new Object();
}
ASP.NET 在生成纯 HTML IFRAME 元素时是否存在问题?
最佳答案
将脚本管理器的脚本模式更改为发布对我来说很有效
在页面的OnInit方法中我添加了这一行
ScriptManager.GetCurrent(Page).ScriptMode = ScriptMode.Release;
关于javascript - ASP.NET 的框架 javascript 不允许我渲染原始 HTML IFRAME,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6690989/