ajax2.0问题

meixiaofeng 2007-11-26 11:21:02
UpdatePanel上多个dropdownlist,autopostback=true
执行selectindexchange事件,其他dropdownlist都有刷新,有什么办法
使其他downlist不刷新
...全文
283 15 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
jeremyyang824 2007-11-26
  • 打赏
  • 举报
回复
放在不同的updatepanel,其中一个刷新,其他panel也会刷新的
--------------------------------------------------
UpdateMode="Conditional"
suyiming 2007-11-26
  • 打赏
  • 举报
回复
放在不同的updatepanel,其中一个刷新,其他panel也会刷新的
================================

不会啊 我都是这样做的啊 没有刷新哦
你说刷新的是它会跳动吧?
jeremyyang824 2007-11-26
  • 打赏
  • 举报
回复
Updatepanel有2个属性 UpdateMode="Conditional" ChildrenAsTriggers="true"
意思是由该updatepanel中的子控件触发该updatepanel的更新

如果要触发更新的控件不在updatepanel中则使用UpdateMode="Conditional"
然后在updatepanel中添加子节点
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnWorkloadAdd" />
<asp:AsyncPostBackTrigger ControlID="btnWorkloadDele" />
</Triggers>
triggers表示触发updatepanel更新的控件集合
meixiaofeng 2007-11-26
  • 打赏
  • 举报
回复
放在不同的updatepanel,其中一个刷新,其他panel也会刷新的
JYYCOM 2007-11-26
  • 打赏
  • 举报
回复
一个updatepanel可以对应一个trigger。
如果你有两个dropdownlist
要求联动,只要把第二个放到updatepanel里面,trigger设置为第一个updatepanel即可
JYYCOM 2007-11-26
  • 打赏
  • 举报
回复
为什么要把所有的dropdownlist放到一个updatepanel里面?
hanbb1982 2007-11-26
  • 打赏
  • 举报
回复
不要放在同一个UpdatePanel里面,因为,如果你做刷新的时候,它是整个UpdatePanel刷新的,那么你其它的dropdownlist也会刷新的吧。
chuxue1342 2007-11-26
  • 打赏
  • 举报
回复
放在不同的updatepanel里面.设置更新模式就好!
qq22345111 2007-11-26
  • 打赏
  • 举报
回复
<form   id="form1"   runat="server"   enctype="multipart/form-data"> 
<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

CeShenBeiWang 2007-11-26
  • 打赏
  • 举报
回复
不要放到同一个UpdatePanel中 只把需要刷新的控件放到UpdatePanel中就好了
jeremyyang824 2007-11-26
  • 打赏
  • 举报
回复
<form id="form1" runat="server" enctype="multipart/form-data">
<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>
zmm12 2007-11-26
  • 打赏
  • 举报
回复
<form id="form1" runat="server" enctype="multipart/form-data">
<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>
shawn_yang 2007-11-26
  • 打赏
  • 举报
回复
放在不同的UpdatePanel
meixiaofeng 2007-11-26
  • 打赏
  • 举报
回复
<form id="form1" runat="server" enctype="multipart/form-data">
<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不刷新

62,243

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧