I'm building a support application that re-uses several dropdown lists that get populated from lookup tables.
I thought I'd try my hand at writing custom controls...
I might be doing this wrong, however, here's how I went about it:
-------------------------------------------------------------------------------------------------
1). I added a Web User Control for each dropdown that I needed.
2). I added a dropdown control to each Web User Control.
3). I populated each dropdown with each lookup table.
There currently are no properties or methods in these Web User Controls, just the code to populate the dropdowns with the data.
Now, when I drop a control onto the page, It works great.
Problem is when I need to get a selected value from this particular Custom Control, I'm having a problem.
This code works to an extent, however, it's NOT retrieving the users selected value of the dropdown. I tried using the findcontrol method to drill down into the control and get the dropdown, but it doesn't seem to be working.
-----------------------------------------------------------------------------------------------------
Dim CBOProblemType As Control = Page.FindControl("CBOProblemType1")
Dim ddProblemType As DropDownList = CBOProblemType.FindControl("ddProblemType")
Dim strStatusID As String = ddProblemType.SelectedValue
-----------------------------------------------------------------------------------------------------
Does anyone have experience doing this sort of thing, or know where a good reference or tutorial is?
Thanks.
Doug Dexter