My goal is to create a composite control that looks like, acts like and behaves like a RadioButtonList. There is some extra things done behind the scenes which are working no problem. What I am unable to accomplish is the desired markup to use the control. My ideal markup looks like this:
<cc1:RadioButtonField ID="rfCardType" runat="server" Title="Card Type:">
<asp:ListItem Enabled="true" Text="MasterCard" />
<asp:ListItem Enabled="true" Text="Visa" />
<asp:ListItem Enabled="true" Text="Amex" />
</cc1:RadioButtonField>
What I would like to do is pass the <asp:ListItems
> to the RadioButtonList in the composite control and have that handle everything required to produce/run the control.
Control Markup for RadioButtonField:
<div class="Title">
<asp:Label ID="lblTitle" runat="server" AssociatedControlID="rblField" />
</div>
<div class="Text">
<asp:RadioButtonList ID="rblField" runat="server" Visible="true">
</asp:RadioButtonList>
</div>
Code Behind for RadioButtonField:
???
What does the RadioButtonField code behind need to do in order to collect the <asp:ListItems
> and pass them to the RadioButtonList?