当前位置:编程学习 > C#/ASP.NET >>

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去掉就不会出现这个问题了,但是又整页刷新了纠结啊
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,