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/
前台:
<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/
相关文章推荐
- RadioButtonList每次只能选择一个并写入数据库
- [ASP.NET MVC]为HtmlHelper添加一个RadioButtonList扩展方法
- [ASP.NET MVC]为HtmlHelper添加一个RadioButtonList扩展方法
- 在ASP.NET MVC下扩展一个带验证的RadioButtonList
- ASP.NET MVC 3 扩展之给 HtmlHelper 扩展一个 RadioButtonList
- asp.net单点登录 一个账号只能在一个地方登录
- Asp.net 实现只能允许一个账号同时只能在一个地方登录
- Asp.net 实现只能允许一个账号同时只能在一个地方登录
- ASP.NET FormView中编辑时的RadioButtonList控件报错,找不到匹配的Value
- ASP.NET控件之RadioButtonList
- ASP.NET查询页面设置form的action属性只弹出一个页面,并且每次将页面设置到最前
- ASP.NET 获取多个 checkbox,radio 被选择的值
- HTML的radio单选按钮实现男、女性别只能选择一个
- 牛腩购物12 :整合用户登录页 用到 asp.net 内置票据认证控件的使用(用户登录 用户权限) 用户控件ascx 设置/获取RadioButtonList 和RadioButton
- 用asp.net 多文件上传 (并且图片即使显示)并隐藏上一个文件选择器
- [参考]一个ASP.Net的DataGrid分页控件,在Oracle数据库下,每次只取当前页的数据,不使用存储过程
- Asp.Net MVC是否针对每次请求都重新创建一个控制器实例
- Web Server Controls->ASP.NET RadioButtonList Control
- ASP.NET控件之RadioButtonList
- ASP.NET做一个下拉式表格选择