Dynamically created TimerControl, inside webpart, won't work.

Last post 11-22-2006 1:54 PM by kosten. 1 replies.

Sort Posts:

  • Dynamically created TimerControl, inside webpart, won't work.

    10-16-2006, 4:37 PM
    • Loading...
    • plamborne
    • Joined on 08-31-2006, 5:14 PM
    • Posts 5

    I have dynamically created webparts (added in codebehind) working, and I have one webpart that has it's own update panel (end result is nested control panels) and it's actually working.  However, putting a TimerControl inside the webpart does not work.  It results in a full page postback on Tick.

    I would like to encapsulate the behavior of the Webpart, so that the main page does not have to know specifics about each webpart, but I can't get the nested TimerControl working.

     I don't expect anyone else is attempting to do what I'm trying to do, but if anyone does know about TimerControls I'd like to hear your ideas.

     Here's the process:

    -Main page has update panels surrounding each webzone
    -On page init, a webservice is called telling the page what the webpart layout should be.
    -A routine in code-behind assembles those webparts (which are all custom user controls, ascx files) and adds them in the appropriate zones

    Everything is all good so far.

    -Maybe one of the ascx files needs to refresh itself every few seconds, so it has a TimerControl
    -I search each webpart looking for anything that needs to be registered with the Atlas Script Manager, and do so with the TimerControl
    -that doesn't work; page does a full post-back rather than partial..

    As I mentioned, I have atlas-enabled one of those webparts resulting in nested updatepanels, and it works as it should... until I add a TimerControl
     

    Thanks for any ideas!

    Filed under: ,
  • Re: Dynamically created TimerControl, inside webpart, won't work.

    11-22-2006, 1:54 PM
    • Loading...
    • kosten
    • Joined on 02-07-2006, 3:45 PM
    • Posts 3
    I have the same situation as yours. the timer control only do a full postback. in my code-behind, i wrap the timer control into the updatepanel control, and it automatically was regared as a child trigger. I guess probably we need to set up asynctrigger for updatepanel. Or we have to get the scriptmanager in the hosting page, and register the timer control there. However, since dynamically webpart is not the part of the parent page control structure. So it;s  a real dilemma.
Page 1 of 1 (2 items)
Microsoft Communities
Page view counter