vendredi 16 septembre 2016

get and set the value from asp.net customized checkbox from server side

This is my html code

<section>
<div class="checkboxFour">
    <input type="checkbox" value="1" id="checkboxFourInput" name="" />
    <label for="checkboxFourInput"></label>
</div>

and this is css code

    <style>
.checkboxFour {
    width: 40px;
    height: 40px;
    background: #ddd;
    margin: 20px 90px;
    border-radius: 100%;
    position: relative;
    box-shadow: 0px 1px 3px rgba(0,0,0,0.5);
}
.checkboxFour label {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 100px;
    transition: all .5s ease;
    cursor: pointer;
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 1;
    background: #333;
    box-shadow:inset 0px 1px 3px rgba(0,0,0,0.5);
}
.checkboxFour input[type=checkbox]:checked + label {
    background: #26ca28;
}

input[type=checkbox] {
    visibility: hidden;
}

</style>

Fiddle Demo

How can I get and set this checkbox value from server side ? Using HiddenField or something ?




Aucun commentaire:

Enregistrer un commentaire