Click here to Skip to main content
15,917,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have used Ajax in my page to load the data from the server side.

I have a combobox filled with data, when selected it should send the selected item to server and get the data to fill in the second combobox.

When the item in the second combobox is selected third combobox should be filled as per the selected item. in same way fourth combobox.

Problem: when the item in the first combobox is selected all the remaining comboboxes controls are created duplicate and shown at the top of the page. the data is filling in those comoboboxes. what could be the problem? why is it so happening

I am using the master pages so that I have placed the script manager in master page.

Related code sample.

XML
<tr>
                                    <th width="145" height="21" align="left" valign="top" scope="col">
                                    <asp:DropDownList ID="ProjectsCmb" runat="server" Width="140px"
                                        CssClass="formlines" Height="28px"
                                        onselectedindexchanged="ProjectsCmb_SelectedIndexChanged"
                                        AutoPostBack="True"  >
                                    </asp:DropDownList>&nbsp;&nbsp;
                                    </th>
                               <asp:UpdatePanel ID="UpdateFilterPanel" runat="server"  UpdateMode="Conditional" >
                                <ContentTemplate>
                                    <th width="145" height="21" align="left" valign="top" scope="col">
                                    <asp:DropDownList ID="SoftwareReleaseCmb" runat="server" Width="140px"
                                        CssClass="formlines"
                                        onselectedindexchanged="SoftwareReleaseCmb_SelectedIndexChanged"
                                        AutoPostBack="True" >
                                     </asp:DropDownList>&nbsp;&nbsp;</th>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="ProjectsCmb" />
                                </Triggers>
                             </asp:UpdatePanel>
                              <asp:UpdatePanel ID="UpdatePanel1" runat="server"  UpdateMode="Conditional" >
                                <ContentTemplate>
                                    <th width="145" height="21" align="left" valign="top" scope="col">
                                    <asp:DropDownList ID="PhasesCmb" runat="server" Width="140px" CssClass="formlines"
                                        onselectedindexchanged="PhasesCmb_SelectedIndexChanged" AutoPostBack="True">
                                    </asp:DropDownList>&nbsp;&nbsp; </th>
                              </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="SoftwareReleaseCmb" EventName="SelectedIndexChanged" />
                                </Triggers>
                             </asp:UpdatePanel>
                              <asp:UpdatePanel ID="UpdatePanel2" runat="server"  UpdateMode="Conditional" >
                                <ContentTemplate>
                                    <th width="145" height="21" align="left" valign="top" scope="col">
                                    <asp:DropDownList ID="RolesCmb" runat="server" Width="140px" CssClass="formlines"
                                       onselectedindexchanged="RolesCmb_SelectedIndexChanged"  AutoPostBack="True">
                                    </asp:DropDownList>&nbsp;&nbsp;</th>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="PhasesCmb" EventName="SelectedIndexChanged" />
                                </Triggers>
                             </asp:UpdatePanel>
                                    <th width="140" height="21" align="left" valign="top" scope="col">
                                    <asp:DropDownList ID="LanguagesCmb" runat="server" Width="130px"
                                        CssClass="formlines" >
                                    </asp:DropDownList></th>
                          </tr>
                          <tr>
                            <th valign="middle" align="center" colspan="5">&nbsp;
                            <asp:UpdateProgress ID="udProgress" runat="server"
                                DisplayAfter="100" Visible="true" DynamicLayout="true">
                                <ProgressTemplate>
                                    <asp:Image border="0" ImageUrl="~/Images/loading.gif" runat="server" />
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                            </th>
                          </tr>
Posted

1 solution

Hi,

Please clear dropdown before bind like:

fillin 1 dropdown clear 2,3 and 4 dropdown then bind
fillin 2 dropdown clear 3 and 4 dropdown then bind
fillin 3 dropdown clear 4 then bind

Please do let me know, if you have any doubt.

Please provide "Vote" if this would be helpful, and make "Accept Answer" if this would be correct answer.

Thanks,
Imdadhusen
 
Share this answer
 
Comments
KishoreT 29-Sep-10 5:51am    
Hey I hope u have not understood the question? what u have suggested is already implemented.

The problem is, the controls on the web page are duplicated in appearance and the controls are moved to the top of the page. At the same I am able to view to sets of each comboboxes, but only one is filling when the slected item event is raised.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900