0

How can I change the password box to disabled.

@Html.Editor("password")

something like

Html.TextBoxFor(model => model.User, new {disabled = "disabled"})
Jean Tehhe
  • 1,247
  • 5
  • 19
  • 38

2 Answers2

0

You're close. You have to prefix your attributes with @:

Html.TextBoxFor(model => model.User, new { @disabled = "disabled" })
Jerad Rose
  • 15,235
  • 18
  • 82
  • 153
0

You can read only text box using Html Attributes

@Html.TextBoxFor(model => model.User, new { @readonly="readonly", style = "width:80%;" })

unique
  • 5,442
  • 6
  • 23
  • 26