postbacks for controls added at PreRender stage of a page

  • Thread starter Thread starter foldface
  • Start date Start date
F

foldface

Hi
If I add a UserControl to a placeholder on a page during that pages PreRender
stage and press a button on that UserControl will the postback for that button
get processed?
I would have thought yes because on adding the control I would have
thought that the OnInit, IPostBackDataHandler, etc calls would then be
applied purely to that calendar, however it doesn't seem to be happening
I'm getting around this at the moment by adding the UserControl to
the placeholder in the OnInit stage and if it shouldn't be there I'm
removing it in the PreRender stage

Thanks for any help

F
 
Are you re-adding the UserControl with the next PostBack? If so, are you
re-adding it prior to the LoadPostData Event?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 
Are you re-adding the UserControl with the next PostBack? If so, are you
re-adding it prior to the LoadPostData Event?

The page has a button and a placeholder. The button is toggling a flag.
If by the PreRender stage (i.e. after postbacks) the flag has been set
then the UserControl is placed in the placeholder. The flag is a static
member variable (at the moment) so once its set it stays set until the
button is pressed again and the UserControl is loaded.
 
Back
Top