【问题标题】:SelectedIndexChanged Event In .ascx UserControl On MasterPageMasterPage 上 .ascx UserControl 中的 SelectedIndexChanged 事件
【发布时间】:2014-10-10 00:53:16
【问题描述】:

请有人帮我解决这个问题:

当我使用 PlaceHolder1.Controls.Add(LoadControl("//UserControls/mycontrol.ascx")) 从添加到母版页的 .ascx 用户控件“DropDownList Box”中选择一个项目时;

.ascx 用户控件在项目被选中后消失

【问题讨论】:

  • 您是如何以及添加什么事件的控件?显示代码

标签: asp.net


【解决方案1】:

您没有显示您的代码,因此很难提供准确的答案。但可能您只动态添加一次用户控件,并且每次回发后它都会消失。 您需要在每次回发后加载 Usercontrol,因此如果您不这样做,则需要以 Page_load 方法加载 Usercontrol。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多