Hi Robert,
Yes, you do need to make the properties public to allow them to be called outside of the control.
Look at message #
863038 where Bonnie talks about how deal with the controls and viewstate to provide the functionality you are looking for.
>Thanks Cathi, I'll try this way.
>This means the properties in the usercontrols have to be 'public'; I'm new to this and therefore I have to ask.
>
>Other questions:
>
When the webform is posted back all my dynamically created usercontrols are gone. What am I doing wrong?
>Is it true that I have to insert the following statement to the the webform which later contains the usercontrols
>'<%@ Register TagPrefix="..." TagName="..." Src=".." '?
>
>Thanks for help!
>
>>Hi Robert,
>>
>>When you work with UserControls, you need to "surface" the properties and methods that you need access to. What I mean is that you need to create a property in the UserControl class that gets/sets the TextBox's Text property. In the code-behind of the webform, you would call this new property on the UserControl to fetch the value stored in the Text property.
>>
>>
>>>hi!
>>>
>>>i've created several usercontrols (vb) which consist of a label an a textbox.
>>>these as placed onto the webform dynamically depending on which option the user selects; they are loaded with loadcontrol into a placeholder-object.
>>>
>>>till here everything works fine!
>>>
>>>now it becomes difficult: how can i save this (usercontrol) textbox.text?
>>>i do not use a dataset which is added to the project, i do create several 'temporary' dataset based on the selected webform.
>>>
>>>thanks for help!
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi