UpdatePanel calling Update() before render

Last post 08-08-2007 4:28 PM by Buzzy. 0 replies.

Sort Posts:

  • UpdatePanel calling Update() before render

    08-08-2007, 4:28 PM
    • Member
      5 point Member
    • Buzzy
    • Member since 08-21-2006, 3:52 PM
    • Posts 2

    Hi all,

    I will describe a strange scenarion, please tell me what you think.

    I have  a page with two update panels. One contains a button and the other contains some controls. At some point I open an IFrame in the middle of the screen and ask the user to fill out some data. When the user fills the data she presses the OK button (in the IFrame) and then the Click() event of the button in the update panel of the main screen is triggered (to cause a postback). In the postback I reach the button handler function and call MyUpdatePanel.Update() to update the other panel in the main window to reflect user's input. This is when I get the "You must call Update before Render" error.

    This is strange because I am before render. I tried to debug this into UpdatePanel.cs and I found the check of the private variable

    _asyncPostBackModeInitialized. The only place where you set it's value is in the SetAsyncPostBackMode method that is called upon Render. Placing breakpoint there revealed that this code is never reached. Infact in the OnLoad event of the UpdatePanel, _asyncPostBackModeInitialized is still 'false' then (without the breakpoint in SetAsyncPostBackMode ever being reached) the breakpoint in Update() is fired and _asyncPostBackModeInitialized is 'true'. I don't understand how this can be.

    Any Ideas?

    Thanks. Boris

    Filed under: ,
Page 1 of 1 (1 items)