hi team, how can i update another dropdownlist without posting back. i've seen the sample somewhere but its not doing anything.
html
VBCode:<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="false" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"> <asp:ListItem Value="0">----Select----</asp:ListItem> <asp:ListItem Value="101">General Admin</asp:ListItem> <asp:ListItem Value="102">Admin Assistant</asp:ListItem> <asp:ListItem Value="103">Software</asp:ListItem> <asp:ListItem Value="104">Recruiting</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID="DropDownList2" runat="server"> <asp:ListItem Value="0">----Select----</asp:ListItem> <asp:ListItem></asp:ListItem> </asp:DropDownList> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel>
Code:Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged DropDownList2.Items.Clear() Select Case DropDownList1.SelectedValue Case 101 DropDownList2.Items.Add("monster truck") DropDownList2.Items.Add("pacman") Case 102 DropDownList2.Items.Add("ghos in the shell") DropDownList2.Items.Add("bomber man") End Select End Sub





Reply With Quote