0

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 ?

DotnetSparrow
  • 27,428
  • 62
  • 183
  • 316

1 Answers1

1

Register the OnSelectedIndexChanged event as asynchronous by setting Triggers property of UpdatePanel.

KV Prajapati
  • 93,659
  • 19
  • 148
  • 186
  • but all controls are inside same updatepanel. why I need to set triggers here? – DotnetSparrow Jun 25 '12 at 13:55
  • @DotnetSparrow Is DropDownList a child of UpdatePanel? – KV Prajapati Jun 25 '12 at 14:14
  • dropdown is part of user control. and user control is placed on a page inside updatepanel. updatepanel is on page – DotnetSparrow Jun 25 '12 at 14:17
  • Please read SO thread - [User control inside update panel causing full page postback](http://stackoverflow.com/questions/3238524/user-control-inside-update-panel-causing-full-page-postback) and [UserControl causes full postback in UpdatePanel](http://stackoverflow.com/questions/5424119/usercontrol-causes-full-postback-in-updatepanel) – KV Prajapati Jun 25 '12 at 14:22
  • @DotnetSparrow the `ClientIDMode="Static"` property of the `` control is causing the AJAX functionality of the UpdatePanel to be thrown away and the control no longer causes an asynchronous postback. This is mentioned @ https://connect.microsoft.com/VisualStudio/feedback/details/584991/clientidmode-static-in-updatepanel-fails-to-do-async-postback. Won't be fixed by MS: "We've identified the underlying issue. Unfortunately a fix is too risky to implement in this area of the product. Given there are a number of posted simple workarounds we're resolving this as won't fix." – bradykey Aug 01 '16 at 23:15