Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Comments
Kornfeld Eliyahu Peter 9-Jan-14 5:52am    
Do you get some code already?
maulikshah1990 9-Jan-14 5:53am    
noi want some code ...

did u understand my question
CBadger 9-Jan-14 5:57am    
what Kornfeld Eliyahu Peter means is copy the code you do have so to see what you want to do...
maulikshah1990 9-Jan-14 6:01am    
i get values in repeater
<%#(DataBinder.Eval(Container.DataItem,"bus")%>


and in aspx page i want


if(<%#(DataBinder.Eval(Container.DataItem,"bus")>==1
mychecked="checked"

<input type="checkbox" name="busueusu" mychecked >

something like this

or u suggest
maulikshah1990 9-Jan-14 6:09am    
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

1 solution

On behalf of OP in order to move the question from Unanswered list.
Quote:
i got the code..thanks for support.i used
XML
<%# DataBinder.Eval(Container.DataItem,"buses").Equals("1") ?"checked":"unchecked"  %>
directly in input type="checkbox"
and it works
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900