0

在有人将此标记为重复之前,我已经查看了我能找到的所有其他问题,只有一个间接解决了我正在尝试做的事情,但由于某种原因它不起作用。

我在嵌入主页的用户控件中有一个 Telerik 下拉菜单控件(用户控件不是动态加载的)。

正如我在其他帖子中看到的那样,我执行以下操作:

    AsyncPostBackTrigger trigger = new AsyncPostBackTrigger();
    trigger.ControlID = ribbonMain.menuDomainSelect.ID;
    trigger.EventName = "ItemClick";
    upnlPanelContent.Triggers.Add(trigger);

此代码运行良好,但页面加载时出现错误:

A control with ID 'menuDomainSelect' could not be found for the trigger in UpdatePanel 'udpnlContentTitle'. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.InvalidOperationException: A control with ID 'menuDomainSelect' could not be found for the trigger in UpdatePanel 'udpnlContentTitle'.

我在更新面板中有下拉菜单,但我也想触发另一个更新面板来更新我页面中的内容。它们被设置为有条件更新。

我在 SO 上看到的其他示例在母版页中有一个用户控件,所以我不明白为什么这不起作用。

4

0 回答 0