简体   繁体   中英

user control's dropdown causing full postback inside updatepanel

I am working on asp.net application and I have an update panel like this:

   <asp:UpdatePanel ID="upCheckout" runat="server">
                    <ContentTemplate>
                        <!-- BillingAddress -->
                        <div runat="server" id="pnlBillingAddress" class="checkoutstep">

                            <asp:Panel runat="server" ID="pnlBillingAddressContent" class="stepcontent">
                                <nopCommerce:CheckoutBillingAddress ID="ctrlCheckoutBillingAddress" runat="server"
                                    OnePageCheckout="true" OnCheckoutStepChanged="ctrlCheckoutBillingAddress_CheckoutStepChanged" />


                                <asp:CheckBox ID="chkShippingSameAsBilling" runat="server" Text="  Ship to same address"
                                    AutoPostBack="true" Checked="true" onclick="ShowShippingAddress();" /><br />
                            </asp:Panel>
                        </div>
                        <!-- ShippingAddress -->
                        <div runat="server" id="pnlShippingAddress" class="checkoutstep">                                
                            <asp:Panel runat="server" ID="pnlShippingAddressContent" class="stepcontent">
                                <nopCommerce:CheckoutShippingAddress ID="ctrlCheckoutShippingAddress" runat="server"
                                    OnePageCheckout="true" OnCheckoutStepChanged="ctrlCheckoutShippingAddress_CheckoutStepChanged" />                                    
                            </asp:Panel>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>

where billing address is a user control. In billing address control, There is a dropdownlost. like this:

  <asp:DropDownList ID="drpBillingAddresses" ClientIDMode="Static" runat="server" AutoPostBack="True" OnSelectedIndexChanged="drpBillingAddresses_SelectedIndexChanged">
                        </asp:DropDownList>

but when I change dropdown selection, I get full post back instead of partial postback. why I am getting full postback ?

通过设置UpdatePanel的Triggers属性,将OnSelectedIndexChanged事件注册为异步事件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM