私の目標は、RadioButtonList のように見え、そのように機能し、そのように動作する複合コントロールを作成することです。問題なく動作しているいくつかの余分なことが舞台裏で行われています。私が達成できないのは、コントロールを使用するための望ましいマークアップです。私の理想的なマークアップは次のようになります。
<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>
私がやりたいことは、<asp:ListItems
> を複合コントロールの RadioButtonList に渡し、コントロールを生成/実行するために必要なすべてを処理させることです。
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>
RadioButtonField の分離コード:
???
<asp:ListItems
> を収集して RadioButtonList に渡すために、RadioButtonField のコード ビハインドは何をする必要がありますか?