Is there anyway to convert the @HTML.Checkboxfor into toggle html button? I have refer the toggle button style from https://www.w3schools.com/howto/howto_css_switch.asp
Currently its working by using :
@Html.CheckBoxFor(model => model.IsEnabled, new { @checked = "checked", @Name = "DelegateChkBox" })
Changed to:
<td class="slider-td">
<label class="switch">
<input name="DelegateChkBox" id="IsEnabled" type="checkbox" value="true" data-val-required="The IsEnabled field is required." data-val="true" data-bind="checked: IsEnabled">
<div class="slider round"></div>
</label>
</td>
The toggle button only works and postback to controller if it's CHECKED:

else it won't postback to controller by default UNCHECKED :
Any help will be appreciated! Thanks!

IsEnabledbut then you change thenameattribute toDelegateChkBoxwhich will never bind to your model (you should never change thenameattribute). And you never set thecheckedattribute - that is done correctly by theCheckBoxFor()method based on the value ofIsEnabled.CheckBoxFor()method generates 2 inputs - a<input type="checkbox" .. value="true" />and a<input type="hidden" value="false" />@Html.CheckBox()rather than manually creating your html - you just need to modify the css selectors