Amir:
Dynamically added controls aren't automatically reloaded on postback.
Viewstate only holds control information, not the actual control itself.
You need to reload the control...and in order for it's event to fire
properly, you need to do it pretty early in the page lifecycle..typically on
onInit, but I think onLoad will work also. Oftentimes, people will put an
array of strings in the viewstate (which contain a list of dynamically added
controls), on postback retrieve the list of strings from viewstate and
reload the controls.
As an alternative, you can use Denis Bauer's Free Dynamic PlaceHolder
control which takes care of all this for you (ie, it recreates the controls
on postback)
http://www.denisbauer.com/ASPNETCont...aceholder.aspx
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Amir Ghezelbash" <am*****@rogers.com> wrote in message
news:OP****************@TK2MSFTNGP14.phx.gbl...
Hey every body;
first off let me say thanks every body..this place is great i have never
came here with a problem and left without an answer..you guys are awsome
any way i had a question rather a problem then a question
i am using a placeholder control in my webform this control
programmically loads up a custom control, the control that it loads up
is a asp.net 2.0 wizard...now here is aproblem,
the control loads up no problem, but the issue is that once the the next
button has been clicked on the wizard and the page refreshes, the
control goes away. i think the place holder unloads the control for
somereason....so the user will never get to step 2 of the wizard....
any suggestion why is this happneing and how can i pervent it ?
thanks in advance
---
Best Regards
Amir
*** Sent via Developersdex http://www.developersdex.com ***