Ok. I see what you want now. If you want to return a value of an user control's internal control you should create a public method on the user control to expose it. If you really need to, you could make the control (dropdown list in your case) public on the control but in most cases, you are only interested in the value/text/item.
Create a public property on the UserControl that exposes the selected Item/Value/Text, whichever you need. So in your user control class, do something like this:
Public Readonly Property AccountNumber() As String
Get
Return ddlAccountList.SelectedValue
End Get
End Property
Now in the page, you can get that value: ucAccountListControl.AccountNumber.
In addition, you might also want to create an event for when the account number changes so you don't need to "get" it every time. This follows the event driven model of .net. In the user control:
Public Event AccountNumberChanged(sAccountNum As String)
In the DDL OnSelectedItemChanged handler:
RaiseEvent AccountNumberChanged(ddl.SelectedValue)
Something to that affect is what you want.
Peter
------------------------------------------------------
Work smarter, not harder.
|