I need to add switch control to my web application. I'm trying to use Kendo Switch control. I want to bind my switch to a model property. I do that with a following way:

<div class="form-group">
    @Html.Label("Guest Mode:")
    <label class="checkbox-inline">
        @Html.CheckBoxFor(m => m.SomeProperty, new {@id = "switch"})
    </label>
</div>
<script>
    var switchInstance = $("#switch").kendoMobileSwitch();
</script>

I tried many ways but can not render so simply control properly (see my screenshot).enter image description here

Also I tried to use only razor syntax but it rendered only a checkbox. What is my problem and how to fix it? Thanks for advance!

Related posts

Recent Viewed