Page getting postback in update panel

Padmanabhan, Venkatesh 125 Reputation points
2023-04-17T05:10:18.3266667+00:00

Hi. I am using script manager and update panel in my aspx page. In the page, I have few dropdown controls , button and gridview. when I click button or there is a postback in dropdown, there is a flickering. How to avoid screen flickering while using the scriptmanager. Below is the code used :

  <form id="form1" runat="server">
        <asp:ScriptManager ID="scriptmanager1" runat="server">  
</asp:ScriptManager>  
        <div class="container-fluid">
          <div>      
          <asp:UpdatePanel ID="updatepnl" runat="server">  
<ContentTemplate> 
 <div >
  <label class="form-label" for="ddlAppln">Select Application</label>
 <div class="dropdown">
  <asp:DropDownList CssClass="btn btn-secondary dropdown-toggle" runat="server" ID="ddlAppln" AutoPostBack="true" >
                            <asp:ListItem Enabled="true" Text="Select Application" Value="-1"></asp:ListItem>
                            <asp:ListItem Text="T1" Value="T1"></asp:ListItem>
                            <asp:ListItem Text="T2" Value="T2"></asp:ListItem>
                            <asp:ListItem Text="T3" Value="T3"></asp:ListItem>                          
                        </asp:DropDownList>
                    </div> </div>
// other controls like dropdown , button, gridview
        </div>
            </ContentTemplate>  
</asp:UpdatePanel>  
        </div>      
    </form>

Is there any code which needs to be added in page load ?

Developer technologies | ASP.NET | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Lan Huang-MSFT 30,191 Reputation points Microsoft External Staff
    2023-04-17T07:31:35.0466667+00:00

    Hi @Padmanabhan, Venkatesh, I cannot reproduce the problem with the code you provided.

    "By default, UpdatePanels will only dynamically refresh the content within them, when triggered by controls within them.""By default, UpdatePanels will only dynamically refresh the content within them, when triggered by controls within them."

    You try to set Button and DropDownList as AsyncPostBackTrigger in trigger section. Set the ChildrenAsTriggers property to true and the UpdateMode property to Conditional.

    <asp:UpdatePanel ID="updatepnl" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">                     <ContentTemplate>                     </ContentTemplate>                     <Triggers>                         <asp:AsyncPostBackTrigger ControlID="ddlAppln" EventName="SelectedIndexChanged" />                         <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />                     </Triggers>                 </asp:UpdatePanel>
    

    Best regards,

    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.