Create a CSS Class
.required-field:after {
color: #d00;
content: "*";
position: absolute;
margin-left: 3px;
top: 10px;
}
Use it only for the tag you want.
<div class="form-group">
<label for="EmployeeName" class="control-label required-field col-sm-2">Employee Name</label>
<div class="col-sm-4">
@Html.TextBoxFor(m => m.EmployeeName, new { @class = "form-control", ng_model = "Employee.EmployeeName", alpha_numeric = "", required = "true" })
</div>
<label for="" class="control-label required-field col-sm-2">Birth Date</label>
<div class="col-sm-4">
@Html.TextBoxFor(m => m.BirthDate, new { @class = "form-control", ng_model = "Employee.BirthDate", required = "true" })
</div>
source
share