触摸屏租赁
Touch screen rental
广告机租赁
Advertising rental
机器人租赁
Robot leasing
 当前位置:首页 > 全部 > asp.net RadioButtonList每次只能选择一个并写入数据库

asp.net  RadioButtonList每次只能选择一个并写入数据库  C#

前台:
<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);
        }

 


工作室地址:重庆石桥铺电脑城B座 | 微信:z35544216 | 网址:www.35544216.com