Skip to content
Loading
Re: How to align labels and text boxes  
  •           
  •   
  •         class="form-group">  
  •             @Html.LabelFor(model => model.SarsNumber, htmlAttributes: new { @class = "control-label col-md-2" })  
  •             class="col-md-10">  
  •                 @Html.EditorFor(model => model.SarsNumber, new { htmlAttributes = new { @class = "form-control" } })  
  •                 @Html.ValidationMessageFor(model => model.SarsNumber, "", new { @class = "text-danger" })  
  •               
  •           
  •   
  •         class="form-group">  
  •             @Html.LabelFor(model => model.UifNumber, htmlAttributes: new { @class = "control-label col-md-2" })  
  •             class="col-md-10">  
  •                 @Html.EditorFor(model => model.UifNumber, new { htmlAttributes = new { @class = "form-control" } })  
  •                 @Html.ValidationMessageFor(model => model.UifNumber, "", new { @class = "text-danger" })  
  •               
  •           
  •   
  •         class="form-group">  
  •             @Html.LabelFor(model => model.EeNumber, htmlAttributes: new { @class = "control-label col-md-2" })  
  •             class="col-md-10">  
  •                 @Html.EditorFor(model => model.EeNumber, new { htmlAttributes = new { @class = "form-control" } })  
  •                 @Html.ValidationMessageFor(model => model.EeNumber, "", new { @class = "text-danger" })  
  •               
  •           
  •   
  •         class="form-group">  
  •             @Html.LabelFor(model => model.SetaID, htmlAttributes: new { @class = "control-label col-md-2" })  
  •             class="col-md-10">  
  •                 @Html.EditorFor(model => model.SetaID, new { htmlAttributes = new { @class = "form-control" } })  
  •                 @Html.ValidationMessageFor(model => model.SetaID, "", new { @class = "text-danger" })  
  •               
  •           
  •   
  •         class="form-group">  
  •             class="col-md-offset-2 col-md-10">  
  •                 "submit" value="Create" class="btn btn-primary btn-block" />  
  •               
  •           
  •       
  • }  
  •   
  •   
  •     @Html.ActionLink("Back to List", "Index")  
  •   
  •   
  • @section Scripts {  
  •     @Scripts.Render("~/bundles/jqueryval")  
  • } 
  •  Thanking you in advance!
     
    Regards,
    Kyle

    1 Reply

    Know the answer? Post it — somebody with the same question will find it here.