您的位置:首页 > 编程语言 > ASP

asp.net中RadioButtonList每次只能选择一个

2012-02-18 13:52 387 查看
asp.net中RadioButtonList每次只能选择一个并写入数据库

前台:

<asp:RadioButtonList ID="RadioButtonList1" runat="server"

RepeatDirection="Horizontal"><asp:ListItem Value="0">未做任何处理</asp:ListItem>

<asp:ListItem Value="1">已派技术员上门</asp:ListItem>

<asp:ListItem Value="2">故障已修复</asp:ListItem>

<asp:ListItem Value="3">故障没有修复</asp:ListItem>

<asp:ListItem Value="4">反修复</asp:ListItem>

</asp:RadioButtonList>

后台:

ZYWEB.BLL.OA_services bll = new ZYWEB.BLL.OA_services();

ZYWEB.Model.OA_services model = new ZYWEB.Model.OA_services();

读取数据

public void BindData()

{

RadioButtonList1.SelectedValue = model.state.ToString();

}

保存到数据库

protected void Button3_Click(object sender, EventArgs e)

{

model.state = RadioButtonList1.SelectedValue;

bll.Update(model);

}

来源:展洋科技:www.35544216.com http://www.cqcopy.com/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: