I got model and inside model we got "IsActive" with bool type. I want is when "IsActive" comes our View by "true", checkbox also start with checked and if it comes with "false" checkbox unchecked. How can i do that? Thanks for helping me!
<input class="togglecheckbox" type="checkbox" id="switch"/>
>Solution :
Use the checked attribute:
<input class="togglecheckbox" type="checkbox" id="switch" checked="@Model.IsActive" />