forum

Home / DeveloperSection / Forums / Binding all college names to a college-dropdownlist based on data selected in another city-dropdownlist , both dropdownlists are placed inside the datalist

Binding all college names to a college-dropdownlist based on data selected in another city-dropdownlist , both dropdownlists are placed inside the datalist

Rashmi S 2419 21-Nov-2014
Binding all college names to a college-dropdownlist based on city name selected in another city-dropdownlist , both dropdownlists are placed inside the datalist.
how should i create SelectedIndexChanged event for city-dropdownlist and to to bind college names to college-dropdownlist? please help me out...!

this is my code
<asp:DataList ID="DLpriority" runat="server" BackColor="White" 
                                BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4"
                                GridLines="Both">
                                <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
                                <HeaderTemplate>
                                    <table style="width:100%;">
                                        <tr>
                                            <td style="width: 103px">
                                                Priority No.</td>
                                            <td style="width: 126px">
                                                City</td>
                                            <td align="center" style="width: 157px">
                                                College
                                            </td>
                                            <td align="center">
                                                Combination</td>
                                        </tr>
                                    </table>
                                </HeaderTemplate>
                                <ItemStyle BackColor="White" ForeColor="#330099" />
                                <ItemTemplate>
                                    <table border="3" style="width:100%;">
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblProirityNo" runat="server" Text='<%# Eval("PriorityNo") %>'
                                                    Width="100px"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="DDLcity" runat="server" Width="200px" AutoPostBack="True"
                                                    onselectedindexchanged="DDLcity_SelectedIndexChanged">
                                                </asp:DropDownList>
                                            </td>
                                            <td style="width: 202px">
                                                <asp:DropDownList ID="DDLcollege" runat="server" Width="200px">
                                                </asp:DropDownList>
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="DDLcourse" runat="server" Width="150px">
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td style="width: 202px">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td style="width: 202px">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                                <SelectedItemStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                            </asp:DataList>

Updated on 22-Nov-2014

Can you answer this question?


Answer

2 Answers

Liked By