Which UpdatePanel issued an Async Postback Call?

Last post 08-29-2007 12:09 AM by WebPrgmer. 3 replies.

Sort Posts:

  • Which UpdatePanel issued an Async Postback Call?

    08-26-2007, 6:59 PM
    • Loading...
    • WebPrgmer
    • Joined on 01-19-2006, 10:26 PM
    • Posts 16

    Hi All,

     I have an aspx page where I have 5 UpdatePanels in which I am loading 5 different user controls dynamically. Each UpdatePanel has a different trigger and UpdateMode set to Conditional. When a user clicks on a Button inside of the 1st UpdatePanel, I know I will need to load the contents again in Page_Load. However, how do I know which UpdatePanel the request came from? If the Button clicked was inside UpdatePanel3, I want to LoadControl again inside UpdatePanel3 only and not inside all other UpdatePanels on the page.

     Is there any way to find out which particular UpdatePanel is updating?

     TIA,

    WebPrgmer.


     

  • Re: Which UpdatePanel issued an Async Postback Call?

    08-26-2007, 9:29 PM
    Answer
    • Loading...
    • jocc
    • Joined on 08-14-2007, 12:10 PM
    • Posts 24

    You can check each UpdatePanel to see IsInPartialRendering property is true or not.

    Please refer to http://msdn2.microsoft.com/en-us/library/system.web.ui.updatepanel.isinpartialrendering(VS.90).aspx for detials.

  • Re: Which UpdatePanel issued an Async Postback Call?

    08-26-2007, 10:54 PM
    • Loading...
    • gt1329a
    • Joined on 06-24-2002, 12:53 AM
    • Atlanta
    • Posts 1,597

    An easier way might be to appropriately handle the Load event of each UpdatePanel, instead of putting it all in Page_Load.

  • Re: Which UpdatePanel issued an Async Postback Call?

    08-29-2007, 12:09 AM
    Answer
    • Loading...
    • WebPrgmer
    • Joined on 01-19-2006, 10:26 PM
    • Posts 16

     Thanks all. I wrote a custom control deriving from UpdatePanel and using the IsInPartialRendering property in RenderChildren. I can detect which exact UpdatePanel is requesting updation like this. However when I add a usercontrol to the page at this stage, I get "Extender controls cannot be added after PreRender" exception. This happens if the user control I am loading has an ajax extender control in it.

     

    I then used the OnLoad method of a regular UpdatePanel control..

     

    Thanks again,

    WebPrgmer.
     

Page 1 of 1 (4 items)