不要放在同一个UpdatePanel里面,因为,如果你做刷新的时候,它是整个UpdatePanel刷新的,那么你其它的dropdownlist也会刷新的吧。
解决方案 »
- 倾家荡产求解!!各位高人,有在win server2003 中asp.net 用cmd 调用flashpaper 转换文件成功的吗?
- Aytomation服务器无法创建对象错误
- VS2005中解决方法(.sln)的问题!!!
- C#中泛型请教
- 如何生成类似于Framework SDK的说明文档?
- TemplateColumn问题,怎么在一个TemplateColumn里面加两个Imgbutton?
- 请教vs08如何升级
- 如何在gridview中添一列图片,且当点击图片时此行数据被隐藏
- Treeview问题(IEWebControls)360KB的我下载了怎么手动添加啊,在线等待
- 初学ASP。NET请高手看一下代码,关于数据库连接
- .net的cookie怎么用啊?
- 公司要做一个新闻采集系统,求源代码或下载地址
如果你有两个dropdownlist
要求联动,只要把第二个放到updatepanel里面,trigger设置为第一个updatepanel即可
意思是由该updatepanel中的子控件触发该updatepanel的更新如果要触发更新的控件不在updatepanel中则使用UpdateMode="Conditional"
然后在updatepanel中添加子节点
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnWorkloadAdd" />
<asp:AsyncPostBackTrigger ControlID="btnWorkloadDele" />
</Triggers>
triggers表示触发updatepanel更新的控件集合
================================不会啊 我都是这样做的啊 没有刷新哦
你说刷新的是它会跳动吧?
--------------------------------------------------
UpdateMode="Conditional"
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" Width="154px">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<br />
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="true" Width="155px">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="true" Width="156px">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
</div>
</form>
点downlist1的时候,downlist2不刷新
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" Width="154px">
<asp:ListItem> 1 </asp:ListItem>
<asp:ListItem> 2 </asp:ListItem>
<asp:ListItem> 3 </asp:ListItem>
<asp:ListItem> 4 </asp:ListItem>
</asp:DropDownList>
<br />
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="true" Width="155px">
<asp:ListItem> 1 </asp:ListItem>
<asp:ListItem> 2 </asp:ListItem>
<asp:ListItem> 3 </asp:ListItem>
<asp:ListItem> 4 </asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="true" Width="156px">
<asp:ListItem> 1 </asp:ListItem>
<asp:ListItem> 2 </asp:ListItem>
<asp:ListItem> 3 </asp:ListItem>
<asp:ListItem> 4 </asp:ListItem>
</asp:DropDownList>
</div>
</form>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" Width="154px">
<asp:ListItem> 1 </asp:ListItem>
<asp:ListItem> 2 </asp:ListItem>
<asp:ListItem> 3 </asp:ListItem>
<asp:ListItem> 4 </asp:ListItem>
</asp:DropDownList>
<br />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="true" Width="155px">
<asp:ListItem> 1 </asp:ListItem>
<asp:ListItem> 2 </asp:ListItem>
<asp:ListItem> 3 </asp:ListItem>
<asp:ListItem> 4 </asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="true" Width="156px">
<asp:ListItem> 1 </asp:ListItem>
<asp:ListItem> 2 </asp:ListItem>
<asp:ListItem> 3 </asp:ListItem>
<asp:ListItem> 4 </asp:ListItem>
</asp:DropDownList>
</div>
</form>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" Width="154px">
<asp:ListItem> 1 </asp:ListItem>
<asp:ListItem> 2 </asp:ListItem>
<asp:ListItem> 3 </asp:ListItem>
<asp:ListItem> 4 </asp:ListItem>
</asp:DropDownList>
<br />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="true" Width="155px">
<asp:ListItem> 1 </asp:ListItem>
<asp:ListItem> 2 </asp:ListItem>
<asp:ListItem> 3 </asp:ListItem>
<asp:ListItem> 4 </asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="true" Width="156px">
<asp:ListItem> 1 </asp:ListItem>
<asp:ListItem> 2 </asp:ListItem>
<asp:ListItem> 3 </asp:ListItem>
<asp:ListItem> 4 </asp:ListItem>
</asp:DropDownList>
</div>
</form>
放不同的Panel