I have say, 10 forms that all have a databound DropDownList. The DropDownList control on every page has ID="Trip" (I could change this, if necessary).
<asp:DropDownList ID="Trip" runat="server" DataTextField="DisplayName" DataValueField="DisplayName" AutoPostBack="True">
</asp:DropDownList>
The code behind is listed below. It's just a bunch of database stuff whose control binding statements are in bold. Instead of repeating this 10 times, I've tried to craft an object oriented solution by making this code a class, overriding OnLoad and having all the forms containing this DropDownList inherit from the new class.
The problem is that the class won't compile because it doesn't know what "Trip" is. I tried to kludge this by declaring "Dim Trip as DropDownList" and issuing "Trip = Page.FindContr ...
Go to the complete details ...