Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controls collection
Message
From
16/03/2009 10:54:08
 
 
To
16/03/2009 10:45:26
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
Miscellaneous
Thread ID:
01388377
Message ID:
01388387
Views:
28
>>>>Hi,
>>>>I have a WebControl - where I programmatically add new controls.
>>>>During Controls.add() - I check Controls.count - it grows... for example it has now 35 controls
>>>>
>>>>I have a button on this page cmdSave - in Click event I check Me.Controls.count - it has just 9 controls.. most of them - controls which I exact drop on control during design time.
>>>>
>>>>The question is..
>>>>How can I get collection of controls which I add to page programmatically
>>>>
>>>>Thanks
>>>>Denis
>>>
>>>So you have a custom control that you add to your form that contains dynamically added other custom controls? Am I understanding this correctly?
>>
>>Hi Mike,
>>Yes, exactly
>
>Just so we're clear, let's refer to your two controls as the HolderControl and the ContentControl...
>
>So how do you "hold" your ContentControl in your HolderControl? Typically I would use a PlaceHolder control for this... and by typically I mean the one time I did it... :-)

Ok.. seems I understand what happens..
When I click on the button - all my controls which I add programmatically gone... Only controls which I put in design mode still there.
Have I any chance to access to those controls in ASP server side.. or I have only a chance use JavaScript code...

About hold controls... I do next
Dim loPanel as Panel = new Panel
Dim loTextbox As WebControls.TextBox = New WebControls.TextBox
Me.Controls.add(loPanel)
loPanel.Controls.add(loTextbox)

Me - is a UserControl
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform