点击 button 重新从数据库取值赋给 updatepanl 里的 dropdownlist
解决方案 »
- 后台调用script脚本的问题
- AjaxPro用jQuery应该怎样实现
- sql 时间字段问题 简单的来拿分阿
- asp.net ajax版本问题ProgressControl
- 关于大数据量查询的问题
- 关于ajaxPro7.7.31.1 的( this.onTimeout is not a function)
- 性能问题?大家帮我出个主意
- 菜鸟求助 关于数据查询的问题
- 在Class中,不继承System.Web.UI.Page,如何引用Session?在线等,非常急!
- 有关Server.Transfer的两点疑问???
- 无法将输入 xml 文件内容转换为数据集。“鐗归噰鎬绘暟閲”是一个意外标记。应为空格
- ruan="server"后JS找不到ID怎么办?
DropDownLis1.Items.Clear();
DropDownListTeam.DataSource = 获得的数据;
//DropDownListTeam.DataValueField = "Name";
//DropDownListTeam.DataTextField = "Name";
DropDownListTeam.DataBind();
updatepanl 里的 dropdownlist否不刷新
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddl" runat="server" Width="15%" AutoPostBack="True" OnSelectedIndexChanged="ddl_SelectedIndexChanged">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</div>
还可
<asp:DropDownList ID="ddl" runat="server" Width="150px" onchange="ddlChange(this);">
</asp:DropDownList>
DropDownListTeam.DataValueField = "值字段";
DropDownListTeam.DataTextField = "显示字段";
DropDownListTeam.DataBind();
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddl" runat="server" Width="15%" AutoPostBack="True" OnSelectedIndexChanged="ddl_SelectedIndexChanged">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</div>
点击button 后重新给dropdownlist 赋值就不行了
button 在UpdatePane外
定义UpdatePanel的异步刷新触发器为button的单击事件,这样就ok了
定义UpdatePanel的异步刷新触发器为button的单击事件
但是dropdownlist不能重新取值,不知怎么搞的
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddl" runat="server" Width="15%" AutoPostBack="True" OnSelectedIndexChanged="ddl_SelectedIndexChanged">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSub" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:Button ID="btnSub" runat="server" OnClick="btnSub_Click" />
</div>正解!!!
这个也用了但就刷新不了,救急