RadioButton 的相关问题!!!
前台代码:
<tr class="listA">
<td width="100" align="center">账号状态</td>
<td><asp:RadioButton ID="A" Text="未冻结" GroupName="a" runat="server" Checked="True" /> <asp:RadioButton ID="B" Text="已冻结" GroupName="a" runat="server" /></td>
<td width="360">账号状态分为未冻结和已冻结,已冻结的账号无法进入后台</td>
</tr>
后置代码:
protected void Page_Load(object sender, EventArgs e)
{
IList<mSAGroup> mode = BLL.SAGroup_BLL.SAGroupList();
type.DataSource = mode;
type.DataTextField = "groupName";
type.DataValueField = "id";
type.DataBind();
if (!IsPostBack)
{
if (Request["id"] != "0")
{
mSA sa = BLL.SA_BLL.SASelectForId(int.Parse(Request["id"]))[0];
userName.Text = sa.userName;
passWord.Text = sa.passWord;
remark.Text = sa.remark;
string authority = sa.authority;
A.Text = authority;
if (A.Text == "未冻结")
{
A.Checked == true;
}
else
{
B.Checked == true;
}
type.SelectedValue = sa.uid.ToString();
}
}
}
后置代码 怎么去能自匹配数据库里的“已冻结”和"未冻结" ,就是这个账号在数据库里的authority字段是这两个任意一个的时候 RadioButton 控件会自己选中对应的那个,求助!!急
------解决方案--------------------