Ok, so this works with one dynamically created control. But not with multiple.
Ok, so this works with one dynamically created control. But not with multiple...
If you are adding dynamic controls, you MUST create/recreate the controls no later than OnInit(). This is the point in the . NET page lifecycle where the viewstate and events are restored.
If it is solely for the purpose of adding dynamic controls that you are using the dynamic placeholder control, then simply putting the control creation/recreation in OnInit() will solve your problem. Give it a try and let me know your results.
Thank you for the response. I had also thought of that, but I give them the option to add dynamic controls at runtime. Therefore this can not be determined OnInit() I don't think :( – Chris Buckler Nov 7 at 18:41 Ok, I just re-read your question and I think I understand a little better.
When the page is posted back, you want to rebuild the existing control structure. Then when the event that caused the postback is raised, you add the new control to the list you have of dynamic controls and rebind the control list. Rinse.Repeat.Am I understanding your situation correctly?
– Shai Cohen Nov 7 at 18:47.
I have been getting some massive head aches working on a very dynamic app. This saves me a lot of hassle when trying to re-create dynamically created controls after a postback. Has anyone else had any issues with attaching a event handler to checkbox control?
Here is my code for the dynamically created checkbox. This works, but its like the event is not getting attached! Here is my event handler!
Now if I was to use a regular placeholder or a panel this works great. And it works perfect. Could someone please tell me, is this an issue with this control, or my coding?
There are no errors, the only thing that is happening that is unexpected is my event is not firing when I'm using the DynamicControlsPlaceholder.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.