UpdatePanel Do Full postback on Dynamic WebControls RRS feed

  • Question

  • User1449651191 posted


    I am searching for a solution for over 20 days,  The problem appears only when I load Web Users Controls as Dynamic in the Default.aspx,

    If I add the by drag it into the page as Static , there is no problem.  

    This is how the code in default.aspx for static (fixed) 

    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <uc1:WebControl1 runat="server" ID="WebControl" />

    I have a Masterpage and Default.aspx and many web controls, 

    I add ScriptManager in the MasterPage as following 

    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"></asp:ScriptManager>
    <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

    and I added the Following in the Default.aspx Page 

    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    I used the following code in the Default.aspx.cs (Code Behind) File to load the pages based on passed parameters 

     // find the place holder
    ContentPlaceHolder mainContent = (ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1");
     // load the control
    //page name is the webcontrol name and its source
    Control MyControl = (Control)LoadControl(pagename);
    // add the control

    I used the following code in the Webcontrol.ascx 

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    some controls such as datagrid, buttons and dropdowns 

    and in the code behind 

     if (IsPostBack == true)

    I hope I can find solution like everytime. 


    Thursday, September 1, 2016 9:03 PM


  • User-1142886626 posted

    Hi Ahmad Jaber,

    If you add an UpdatePanel control to your page, you can achieve a partial-update of your page on a postback. Only the content in the UpdatePanel is refreshed. So, when controls that are placed inside an UpdatePanel of a custom web control cause the whole page to raise a post back. You could make sure each control inside the update panel have an id. After all the controls inside the update panel are assigned ids, the controls inside the UpdatePanel won’t cause the page to raise post backs anymore.

    Besides, you could refer the following link. Hope be helpful with you.



    Best Regards,


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 5, 2016 9:14 AM