我正在尝试使用UpdatePanels,PopupControlExtenders和自定义控件来创建复选框的下拉列表。它的工作原理大部分除了1奇怪的故障我似乎无法找到解决方法。
为了复制故障,您必须按以下顺序执行以下操作。
无论出于何种原因,在步骤3中取消选中权限都没有效果,但检查它们有效吗?我考虑从Request.Params获取正确的值,但它看起来不像是给了我想要的东西。只有当您按顺序执行步骤时才会发生故障,如果您切换步骤2和3它可以正常工作。
答案 0 :(得分:1)
您会考虑取消UpdatePanels吗?我能够使用您的原始代码重现故障。删除UpdatePanel后,毛刺不再可重现:
<fieldset>
<legend>Role</legend>
<table width="500">
<tr>
<td>A</td>
<td valign="top">
<asp:DropDownList ID="Roles" runat="server" AutoPostBack="True" OnSelectedIndexChanged="roles_SelectedIndexChanged">
</asp:DropDownList>
</td>
<td valign="top">
<%-- <asp:UpdatePanel ID="UpdatePanel" runat="server">
<ContentTemplate>--%>
<asp:TextBox ID="txtAuthority" Text="Authorities" runat="server" CssClass="txtboxaschkbox" Visible="false"></asp:TextBox>
<asp:Panel runat="server" ID="PnlAuth" Visible="false" CssClass="PnlDesign">
<cc1:EnhancedCheckboxList ID="Authorities" runat="server">
</cc1:EnhancedCheckboxList>
</asp:Panel>
<cc2:PopupControlExtender runat="server" ID="PceSelectAuthority" TargetControlID="txtAuthority"
PopupControlID="PnlAuth" Position="Bottom"/>
<%-- </ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Roles" />
</Triggers>
</asp:UpdatePanel>--%>
</td>
</tr>
<tr>
<td>B</td>
<td valign="top">
<asp:DropDownList ID="Roles2" runat="server" AutoPostBack="True" OnSelectedIndexChanged="roles2_SelectedIndexChanged">
</asp:DropDownList>
</td>
<td valign="top">
<%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>--%>
<asp:TextBox ID="txtAuthority2" Text="Authorities" runat="server" CssClass="txtboxaschkbox" Visible="false"></asp:TextBox>
<asp:Panel runat="server" ID="PnlAuth2" Visible="false" CssClass="PnlDesign">
<cc1:EnhancedCheckboxList ID="Authorities2" runat="server">
</cc1:EnhancedCheckboxList>
</asp:Panel>
<cc2:PopupControlExtender runat="server" ID="PceSelectAuthority2" TargetControlID="txtAuthority2"
PopupControlID="PnlAuth2" Position="Bottom"/>
<%-- </ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Roles2" />
</Triggers>
</asp:UpdatePanel>--%>
</td>
</tr>
</table>
</fieldset>