我很烦恼的问题,我有这样的updatepanel中的重复控制。页面刷新在点击checboxlist在中继器
<asp:UpdatePanel ID="UpdPnlConstituentRepeater" ChildrenAsTriggers="true" runat="server">
<ContentTemplate>
<asp:Repeater ID="repConstituentInformation" runat="server" OnItemDataBound="repConstituentInformation_ItemDataBound">
<ItemTemplate>
<asp:DropDownList ID="dropRegistrantDownCostType" runat="server" AppendDataBoundItems="true"
AutoPostBack="true" OnSelectedIndexChanged="dropRegistrantDownCostType_SelectedIndexChanged"
EnableViewState="true">
<asp:ListItem Text="Select Type" Value="0" Selected="True" />
</asp:DropDownList>
<asp:CheckBoxList ID="chkBoxListRegistrantBenefits" AutoPostBack="true" runat="server"
OnSelectedIndexChanged="chkBoxListRegistrantBenefits_SelectedIndexChanged">
</asp:CheckBoxList>
</itemTemplate>
</ContentTemplate>
</asp:UpdatePanel>
我的脸,每当我选择从下拉列表中所有的页面被刷新的谷歌花了几个小时后,我找到了一个解决方案,即,对直放站的ItemDataBound事件的任何值,我们只需要后添加以下代码的问题发现下拉菜单,
Dim sm As ScriptManager = ScriptManager.GetCurrent(Page)
sm.RegisterAsyncPostBackControl(objDropdownlist)
它工作得很好下拉,但同样是不工作的CheckBoxList的一样,如果我写sm.RegisterAsyncPostBackControl(chkBoxListRegistrantBenefits)
使用scripmanager例如,它不工作:(
您必须指定在更新面板中的''部分,声明你的下拉列表,并作为复选框[AsyncPostBackTrigger](http://msdn.microsoft.com/en-us/library/system.web.ui.asyncpostbacktrigger的.aspx)秒。 –
@JimSchubert:这不应该是必要的,但它仍然可以解决他的问题。 –
尝试将'ClientIDMode =“AutoID”'添加到Repeater控件。你不应该添加任何触发器,你甚至不需要调用RegisterAsyncPostBackControl。 'ChildrenAsTriggers'应该照顾到这一点。 – kevev22