c# 4.0 - How can i work with the ASP.NET Update Panel? -
in asp.net application have 2 dropdownlist,if select first one's 1 value means automatically want change values of dropdown two,but not working.here asp code.
<asp:scriptmanager id="scriptmanager1" runat="server"> </asp:scriptmanager> <asp:updatepanel id="updatepanel1" runat="server"> <contenttemplate> <asp:label id="label1" runat="server" text="state"></asp:label> <asp:dropdownlist id="ddlstate" runat="server" height="23px" width="195px" onselectedindexchanged="dropdownlist1_selectedindexchanged" autopostback="true"> <asp:listitem>--select--</asp:listitem> <asp:listitem>kerela</asp:listitem> <asp:listitem>tamilnadu</asp:listitem> <asp:listitem>karnataka</asp:listitem> </asp:dropdownlist> <br /> <br /> <br /> <br /> <asp:label id="label2" runat="server" text="district"></asp:label> <asp:dropdownlist id="ddldistrict" runat="server" height="23px" width="189px" autopostback="true"> </asp:dropdownlist> </contenttemplate> </asp:updatepanel>
i copied code is, , gave definition selected index changed event
protected void dropdownlist1_selectedindexchanged(object sender, eventargs e) { listitem li = new listitem("text"); ddldistrict.items.add(li); }
and worked beautifully. might have other issue. can copy selected index changed event code?
Comments
Post a Comment