asp.net的RadioButton控件的使用
1、前台:
<asp:RadioButton ID="rbPrintNo" GroupName="AbnormalType" Text="分单" runat="server"
Checked="true" OnCheckedChanged="rbPrintNo_CheckedChanged" AutoPostBack="true" />
<asp:RadioButton ID="rbWaybill" GroupName="AbnormalType" Text="主单" runat="server"
Checked="false" OnCheckedChanged="rbWaybill_CheckedChanged" AutoPostBack="true" />
把GroupName="AbnormalType" 设置为一样的,就是把他们分组,同一组的就只能单选。
注意:一定要加属性AutoPostBack="true" ,这样才能执行后台的CheckedChanged事件。