How to get materializecss checkbox to work with @Html.CheckBoxFor?

后端 未结 3 1660
醉酒成梦
醉酒成梦 2020-12-11 08:01

So I\'m having an issue trying to implement materializecss\' checkbox with @Html.CheckBoxFor. If I input exactly:



        
3条回答
  •  感动是毒
    2020-12-11 08:44

    Case 1:
    
    @Html.LableFor(x=>x.IsVpn)
    @Html.CheckBoxFor(x=>x.IsVpn) (Suppose)
    
    render like that
    
    
    
    
    
    But We Need like that For materialize css
    
    
    
    
    
    
    Case 2:
    
    @Html.CheckBoxFor(x=>x.IsVpn) (Suppose)
    @Html.LableFor(x=>x.IsVpn)
    
    Now What happen:
    
    
    
    
    
    But our requirement is for materilize css :
    
    
    
    
    
    So we can't use @Html.CheckBoxFor materializ css directly
    
    but it we can use output:
    
    
    
    
    
    it will work exactly same as checkboxfor.
    
    But If we want razor syntax then we need to customize checkboxfor and need to make a extension..
    

提交回复
热议问题