I am facing some confusion. In my MVC5 project, I am trying to display a form with 4 input fields. The display looks perfect without using the @using (HTML.BeginForm(...) statement.
@using(Html.BeginForm("Create", "HR", FormMethod.Post)) {
When the @using(HTML.BeginForm(...) statement is added, the display changes to something like this: https://i.sstatic.net/bU0bn.png
I am wondering where I might have gone wrong in my HTML helper?
Here are some sample HTML helper methods that I am using:
<div class="panel-group">
<div class="panel panel-primary">
<div class="panel-heading"><h4>Create New Employee</h4></div>
<div class="panel-body">
<form class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">First Name</label>
<div class="col-sm-10">
@Html.TextBoxFor(m => m.FirstName, new { @class = "form-control", placeholder = "Enter First Name" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="pwd">Middle Name</label>
<div class="col-sm-10">
@Html.TextBoxFor(m => m.MiddleName, new { @class = "form-control", placeholder = "Enter Middle Name" })
</div>
</div>
</form>
</div>
</div>