I'm a .NET newbie, but here is my question:
I have an application that makes use of Master Pages. I have a page that has a formview on it used to input address information. In the insertitemtemplate is a usercontrol that I am referencing. This usercontrol is a dropdownlist that lists countries. The usercontrol has public properties to get and set the selected value. The usercontrol is not databound, but static. The id of the usercontrol in the user control .ascx files is "DropDownListCountry". When I reference it on the formview in the page, the ID is "fvDropDownListCountry".
When I am executing the command to save the user input of the formview, I want to get the selected value that the user has indicated of which country they have selected. For the other input areas, which are text boxes, I am able to use the code such as:
Dim street1 As String = CType(myFrmView.FindControl("fvTextBoxStreet1"), TextBox).Text
Quite obviously, this approach doesn't work for a drop down list which is inside of the user control. I can't forexample use:
Dim country As String = TryCast(myFrmView.FindControl("fvDropDownListCountry"), DropDownList).SelectedValue
I've looked all around to try to find the answer on how to get the selected value from this user control, but being new at this, haven't found it yet. I have looked at functions to recursively examine a control for child controls, but haven't been able to make this work.
Any help would be appreciated