postbacks for controls added at PreRender stage of a page

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
 
K

Kevin Spencer

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.
 
F

foldface

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top