Asp.net 如何在下拉菜单SelectedIndexChanged事件中保存数据而不重新加载页面
我正在尝试更新DropdownList的selection Index Changed事件上的DataTableAsp.net 如何在下拉菜单SelectedIndexChanged事件中保存数据而不重新加载页面,asp.net,c#-4.0,Asp.net,C# 4.0,我正在尝试更新DropdownList的selection Index Changed事件上的DataTable 我想要的是,当我选择/更改dropDownList项时,所选值应保存到数据库中,而无需页面刷新(无自动回邮)。您需要将自动回邮设置为true。 但您可以使用更新面板进行部分回发,而不刷新整个页面 像这样使用它: <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always" ChildrenAsTri
我想要的是,当我选择/更改dropDownList项时,所选值应保存到数据库中,而无需页面刷新(无自动回邮)。您需要将
自动回邮设置为true。
但您可以使用更新面板进行部分回发,而不刷新整个页面
像这样使用它:
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always" ChildrenAsTriggers="true" >
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem>item 1</asp:ListItem>
<asp:ListItem>item 2</asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
项目1
项目2
数据表
数据库
。你能展示一下你有什么吗?如果你想根据客户端提供的选择/值更改服务器创建的数据,你必须将任何内容发布到服务器上!您可以选择部分回发还是整页回发,但最后,服务器需要知道!