How can we make a checkbox checked or unchecked programatically based on the value? That is to say, for a particular user if the value is true, the checkbox should be checke
You have to have a name for the checkbox, eg:
<input name=checkBox1 type="checkbox" class="checkbox">
For functionality :
if(x==1){
checkBox1.Checked = true; //To Check
}
else{
checkBox1.Checked = false // To Uncheck
}
try this:
<input type="radio" name="filter_favorites" value="Favorites" @(loggedIn ? "checked" : "") />
So this is a simple radio button which checks loggedIn variable & if true radio button will be checked else not.