What are the properties of HTML IN Asp.net MVC.

QuestionsWhat are the properties of HTML IN Asp.net MVC.
AnonymousPublished on: 6/8/2025 3:12:54 AM
What are the properties of HTML IN Asp.net MVC.

1 Answers
Best Answer 0
priyanka 5/4/2018 1:39:00 AM

you are talking about @HTML or HTML attributes

When using this code:

@Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" })

The application will use this method in the "System.Web.Mvc"-namespace. And here is the second parameter the htmlAttributes. This is a attribute with the IDictionary type. You can here enter any HTML-attribute and set the value.

Example:

@Html.LabelFor(m => m.Email, new { @class = "SmallInput", value = "someValue", data_validationType = "email" })

Will result in the following HTML-code:

<label class="SmallInput" for="Email" value="someValue" data-validataionType="email">SomeEmailLabelText</label>