RadioButton控件
比如现在有两个RadioButton控件id分别为r1,r2,并且有个各自的Text属性值,Checked都为false。如何实现点击r1,r2.Text立即变化为指定的其他值?
[解决办法]
前台: <asp:RadioButton ID="RadioButton1" runat="server" AutoPostBack="True"
oncheckedchanged="RadioButton1_CheckedChanged" />//注意设置AutoPostBack="True"
<asp:RadioButton ID="RadioButton2" runat="server" />
后台:
protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
RadioButton2.Text = "点击变化的值!";
}