使用条件在aspx页面中选中输入复选框 [英] make input checkbox checked in aspx page with condition

查看:75
本文介绍了使用条件在aspx页面中选中输入复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有输入复选框,

并从数据库获取值到asp:repeater

所以我检查数据库中的值== 1,我输入复选框为检查



如何在html< %%>中使用,并检查<%#DataBinder.Eval(Container.DataItem,dbvalue)%== 1,选中输入复选框

i have input check box ,
and get value from database into asp:repeater
so i check if value from database ==1 , i make input checkbox as checked

how to use in html <%%> , and check if <%# DataBinder.Eval(Container.DataItem, "dbvalue") %==1 , make input checkbox checked

推荐答案

代表OP为了从未答复的列表中移动问题。

On behalf of OP in order to move the question from Unanswered list.
引用:

我得到了代码..谢谢支持。我用了

i got the code..thanks for support.i used

<%# DataBinder.Eval(Container.DataItem,"buses").Equals("1") ?"checked":"unchecked"  %>

直接在输入类型=复选框

,它的工作原理

directly in input type="checkbox"
and it works


这篇关于使用条件在aspx页面中选中输入复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆