Reputation: 220
I am trying to update a DataTable on selection Index Changed event of DropdownList.
What I want is when I select/change dropDownList Item, the Selected Value should be saved into the database without Page refresh(without AutoPostback).
Upvotes: 0
Views: 1622
Reputation: 17724
You will need to set AutoPostback
to true.
But you can use an update panel to do a partial PostBack and not refresh the complete page.
Use it like this:
<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>
Upvotes: 1