1

I'm listing the data in database by using checkbox, but the checkbox need to be locked. How Can I do this?

My code looks like the following:

<td align="center">
    @Html.CheckBox("WordSwap",@item.WordSwap)
</td>
Sir Rufo
  • 18,395
  • 2
  • 39
  • 73
Hasan ARI
  • 17
  • 6

1 Answers1

2

Presuming that you mean read-only, you can use the following syntax:

@Html.CheckBox("WordSwap", @item.WordSwap, new { @disabled = "disabled" })
Seany84
  • 5,526
  • 5
  • 42
  • 67