c# - convert CheckBoxFor to jQuery UI button -


i have check boxes in mvc app, i'd convert fancy jquery ui buttons detailed here: https://jqueryui.com/button/#checkbox

my code:

<td align="center">@html.checkboxfor(model => model.rjanval)</td> 

sample code:

<input type="checkbox" id="check"><label for="check">toggle</label> 

how do it? don't understand enough happens in here "(model => model.rjanval)", can convert code. new c# , mvc why struggle.

please :)

(model => model.rjanval) result in generation of attributes name , id relatively property gave (only html helpers generating inputs, selects, textareas, ...).

for labels, generate attribute for.

so checkbox should have name="rjanval" , id="rjanval".

and label have for="rjanval".

so, can write cshtml code this:

<td align="center">     <div id="buttons>         @html.checkboxfor(model => model.rjanval)         @html.labelfor(model => model.rjanval)     </div> </td> 

and js:

$(function() {     $("#rjanval").button();     $("#buttons").buttonset(); }); 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

android - CoordinatorLayout, FAB and container layout conflict -