このようにしますか?
<table>
<tr>
<td>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatLayout="Flow">
<asp:ListItem Text="Question 1" Value="1"></asp:ListItem>
<asp:ListItem Text="Question 2" Value="2"></asp:ListItem>
<asp:ListItem Text="Question 3" Value="3"></asp:ListItem>
</asp:RadioButtonList>
</td>
<td>
<div style="display: none; padding-left: 25px" id="ExplanationContent">
<label>Explanation 1</label><br />
<label>Explanation 2</label><br />
<label>Explanation 3</label>
</div>
</td>
</tr>
</table>
<input id="Button1" type="button" value="button" onclick="showExplanation()" />
<script type="text/javascript">
function showExplanation() {
document.getElementById('ExplanationContent').style.display = "block";
}
</script>
説明は、彼らがラジオボタンのテキストと同じスタイルを持っていることを確認するために<label>
タグ内にラップされています。
ありがとうございます...しかし私の場合、radiobuttonlistオプションはデータベースから取り込まれます。だから、理想的には、ラベルもコードビハインドを介してデータベースから移入する必要があります。 – Redsesame
これは問題ではありません。それらの '