locked
AJAX calls refreshing whole page. RRS feed

  • Question

  • User-1635004321 posted

    Hello i am trying to display product name in a dropdown lost and when the index is changed am showing another list of the products under that product name category and further models of that category.

    My code is here

      <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" >
                             <ContentTemplate> 
                        <tr>
                            
                            <td class="auto-style3">Equipment Name</td>
                            <td>
                                    <asp:DropDownList ID="equipment_name_DropDownList" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="product_name" DataValueField="product_name" OnDataBound="equipment_name_DropDownList_DataBound" OnSelectedIndexChanged="equipment_name_DropDownList_SelectedIndexChanged">
                                    </asp:DropDownList>
                                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RegConnectionString %>" SelectCommand="SELECT DISTINCT [product_name] FROM [Products]"></asp:SqlDataSource>
                            </td>
                                 
                        </tr>
                        <tr>
                            <td class="auto-style3">Equipment Make</td>
                            <td>
                                <asp:DropDownList ID="equipment_make_DropDown" runat="server" AutoPostBack="True" OnDataBound="equipment_make_DropDown_DataBound" OnSelectedIndexChanged="equipment_make_DropDown_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style3">Equipment Model</td>
                            <td>
                                <asp:DropDownList ID="equipment_model_DropDown" runat="server" OnDataBound="equipment_model_DropDown_DataBound">
                                </asp:DropDownList>
                            </td>
                        </tr>
                         </ContentTemplate>
                            <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="equipment_name_DropDownList" EventName="equipment_name_DropDownList_SelectedIndexChanged" />
                            <asp:AsyncPostBackTrigger ControlID="equipment_make_DropDown" EventName="equipment_make_DropDown_SelectedIndexChanged" />
                            </Triggers>
                         </asp:UpdatePanel>  

    This refreshes the whole page and not just the update panel.Please help about where i go wrong.

    Thank You.

    Sunday, May 11, 2014 2:53 AM

Answers