When using an ASP.NET CheckBox
(and in out case, inherited from a CheckBox
) it renders a span around the checkbox input control, this span control
/* remove the relative spam involving inputs disabled */ $('input[name=""]').parent('.aspNetDisabled').each(function () { var $this = $(this); var cssClass = "onoffswitch-checkbox"; $('input[name=""]').addClass(cssClass).unwrap().parent('label[for],span').first().addClass('onoffswitch-checkbox'); });
This will allow you to use the check box normally, still have it call server side code, and use the toggle from bootstrap. (I'm using the Inspina theme but it should be the same format for other toggles)