【发布时间】:2009-07-29 21:20:46
【问题描述】:
如何在用户控件的 AdditionalControl 事件中访问主页对象?
我正在尝试运行代码行 ScriptManager oSCM = ScriptManager.GetCurrent(this.Page); 在那种情况下,但它返回 null,即使父页面上有一个脚本管理器。在 WUC 的 OnInit 事件中,同一行代码返回 scriptmanger 对象,但不在 addcontrol 中。我是否在该事件中错误地使用了页面对象 - 我需要以不同的方式访问它吗?
干杯
MH
【问题讨论】:
标签: asp.net user-controls