这篇文章给大家介绍利用CheckBox控件怎么在提交时永远获得选中状态,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。
北京ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18980820575(备注:SSL证书合作)期待与您的合作!写个项目,从数据库中获得的数据绑定值Checkbox,绑定方法如下
//加班设置数据绑定 protected void CheckBoxBind() { OverTimeBLL overTimeBll = new OverTimeBLL(); ListoverTimeList = new List (); overTimeList = overTimeBll.GetAll(); if (overTimeList.Count > 0) { //绑定页面信息 txtID.Text = overTimeList[0].ID.ToString(); if (overTimeList[0].IsEarlyValid.ToLower() == "true") cbIsEarlyValid.Checked = true; if (overTimeList[0].IsLaterValid.ToLower() == "true") cbIsLaterValid.Checked = true; if (overTimeList[0].IsOnlyHoliday.ToLower() == "true") cbIsOnlyHoliday.Checked = true; if (overTimeList[0].IsUseTime.ToLower() == "true") cbIsUseTime.Checked = true; if (overTimeList[0].IsUseNum.ToLower() == "true") cbIsUseNum.Checked = true; txtMinDuration.Text = overTimeList[0].MinDuration.ToString(); } }