hussainAbid
asked on
ASP.NET Nested User Control
Hi Experts,
I have one page and two user controls. User Control B is a nested control within Control A and Control A is sitting at Page.
I am adding one instance of Control B to Parent control A it displays fine but then I have a command button on Control A (parent control) and every time command button is clicked one instance of Control B is added to a container in Control A. But problem is only very first added instane of Control B is being displayed/rendered. Nothing else is showing. how can I achieve this.
I am trying to achieve an effect like some email web interfaces allow additions of as many "TO" addresses as possible and new rows keep appearing. Let say that row was a user control and I want to appear one new when "Add" is clicked.
Please help i have spent two days but cudnt make it work !!!
I have one page and two user controls. User Control B is a nested control within Control A and Control A is sitting at Page.
I am adding one instance of Control B to Parent control A it displays fine but then I have a command button on Control A (parent control) and every time command button is clicked one instance of Control B is added to a container in Control A. But problem is only very first added instane of Control B is being displayed/rendered. Nothing else is showing. how can I achieve this.
I am trying to achieve an effect like some email web interfaces allow additions of as many "TO" addresses as possible and new rows keep appearing. Let say that row was a user control and I want to appear one new when "Add" is clicked.
Please help i have spent two days but cudnt make it work !!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much for answer but here are two issues:
1) even though i have marked the control code behind a SERianlizable it still gives error that useControl is not marked as serializable.
2) controls added dynamically does not appear (only very first added one does) and seems like it is because creating a control instance at a command button level is far too late for the page life cycle to render it along. Any suggessions please?
Looking forward to hear from fellas out there :)
1) even though i have marked the control code behind a SERianlizable it still gives error that useControl is not marked as serializable.
2) controls added dynamically does not appear (only very first added one does) and seems like it is because creating a control instance at a command button level is far too late for the page life cycle to render it along. Any suggessions please?
Looking forward to hear from fellas out there :)
Hello hussainAbid,
Did you tried suggestion as I asked you?
Regards,
VSS
Did you tried suggestion as I asked you?
Regards,
VSS
ASKER
Many thanks and sorry for late response i was put on another rather urgent task :). Happy programming!!
Open in new window