asp.net使用updatepanel实现局部刷新时,实现了局部刷新,但是莫名其妙生成了新的控件?怎么回事?
代码如下: <asp:ScriptManager ID="ScriptManager2" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<tr><td>
<br />
<label> 款式选择:</label></td></tr>
<label>
<asp:RadioButtonList ID="rblStyle" runat="server"
RepeatDirection="Horizontal"
onselectedindexchanged="rblStyle_SelectedIndexChanged" AutoPostBack="True">
<asp:ListItem Value="rbMale">男士</asp:ListItem>
<asp:ListItem Value="rbFemale">女式</asp:ListItem>
<asp:ListItem Value="rbChild">童鞋</asp:ListItem>
</asp:RadioButtonList>
<br />
类型选择:</label>
<br />
<label>类型一:</label><asp:DropDownList ID="dplBtype1"
runat="server" Width="90px" Height="20px"
onselectedindexchanged="dplBtype1_SelectedIndexChanged1"
AutoPostBack="True">
</asp:DropDownList>
<br />
<br /> <label>类型二:</label><asp:DropDownList ID="dplBtype2" runat="server" Width="90px"
onselectedindexchanged="dplBtype2_SelectedIndexChanged1" Height="20px">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="rblStyle" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="dplBtype1" EventName="SelectedIndexChanged"/>
</Triggers>
</asp:UpdatePanel>
追问:就是添加了triggers的那两个控件 rblStyle和dplByte1 包括前面的label没有啊,把trigger去掉就不会出现这个问题了,但是又整页刷新了纠结啊
答案:多生成了什么控件?
其他:前台的代码看着是没有什么问题的,你确定你后台写的时候没有在前台添加控件的代码吗?
上一个:如何得到asp.net中一些漂亮控件
下一个:C# ASP.NET 问题