I have a page with a panel and several buttons. Clicking the buttons loads specific user controls(.ascx files) into the panel. That works fine. Those user controls contain text boxes. I want to save the values entered into those boxes. But I'm having trouble getting their values. The following code is what I have in my "save" button for testing, but it gets me nothing:
Code:
For Each myControl As Control In Page.Controls 'All controls on the page
For Each myControl2 As Control In myControl.Controls 'One of these should be my panel
For Each mycontrol3 As Control In myControl2.Controls 'The only control in my panel is my user control
For Each mycontrol4 As Control In mycontrol3.Controls 'There should be text boxes in this collection
If TypeOf mycontrol3 Is TextBox Then
Label1.Text += CType(myControl2, TextBox).Text & ","
End If
Next
Next
Next
Next