Friday 2 December 2016

MVC - change width of EditorFor


Watch this example on YouTube:




add the following to css class
.width200{
    width: 200px;
}

now ensure EditorFor is pointing to the class above
  @Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @class = "width200" } })

No comments:

Post a Comment