【发布时间】:2008-10-22 13:11:22
【问题描述】:
我有一个包含 DropDownList 的 CompositeControl。
我已将 DropDownList 的 AutoPostBack 属性设置为 true。
在页面上,我有:
<asp:UpdatePanel ID="UpdatePanel" runat="server">
<ContentTemplate>
<MyControl:Control ID="CustomControl" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
我也尝试过设置 ChildrenAsTriggers="true" 和 UpdateMode="Always,",但都没有解决问题。
问题是UpdatePanel 没有拦截CompositeControl 的DropDownList 的回发。 (更改 DropDownList 时正在执行完整的 POST)
如何让 UpdatePanel 处理回发?
谢谢!
编辑 -- 请求的信息
Country 和 states 都是 CompositeControl 中的 DropDownLists。
country.SelectedIndexChanged += new EventHandler(country_SelectedIndexChanged);
protected void country_SelectedIndexChanged(Object sender, EventArgs e)
{
states.DataSource = XXX;
states.DataBind();
}
【问题讨论】:
-
您在页面上或您的控制范围内是否还有其他 UpdatePanel?此外,您能否显示 DropDownList 的 SelectedIndexChanged 事件处理程序和委托定义的代码。
-
不,我在页面或控件中没有任何其他 UpdatePanel。我将编辑我的帖子以显示处理程序。
标签: asp.net asp.net-ajax