不让DropDownList刷新页面,但OnSelectedIndexChanged事件需要触发,怎样实现

xibeipingyuan 2012-04-13 05:20:51
<asp:DropDownList ID="DDL_Type" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DDL_Type_SelectedIndexChanged">
</asp:DropDownList>


protected void DDL_Type_SelectedIndexChanged(object sender, EventArgs e)
{

if (Convert.ToInt32(this.DDL_Type.SelectedValue) > 0)
{
TProductType type = new TProductType("");
this.DDL_DetaiType.DataSource = type.GetList1(Convert.ToInt16(this.DDL_Type.SelectedValue));
this.DDL_DetaiType.DataValueField = "FID";
this.DDL_DetaiType.DataTextField = "FTypeName";
this.DDL_DetaiType.DataBind();
UpdatePanelNewPerAssetReg.Update();

}
}

不让dropdownlist刷新页面,但是OnSelectedIndexChanged还要触发,怎样实现,请大家帮帮忙
...全文
240 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
facelessvoidhj 2012-04-13
  • 打赏
  • 举报
回复
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:UpdatePanel ID="" runat="">
<ContentTemplate>
<asp:DropDownList ID="DDL_Type" runat="server"AutoPostBack="true"OnSelectedIndexChanged="DDL_Type_SelectedIndexChanged">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
xibeipingyuan 2012-04-13
  • 打赏
  • 举报
回复
dropdownlist在UpdatePanel里边了,可是不行
孟子E章 2012-04-13
  • 打赏
  • 举报
回复
使用UpdatePanel控件

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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