Is there a built in function that basically takes an object parameter from a model and creates a complete form based on that?
Currently I'm doing a line for each property:
@model AutomatedTellerMachine.Models.ContactFormModel
@using (Html.BeginForm())
{
<div class="form-horizontal">
<div class="form-group">
<div class="col-md-10">
<input type="text" name="name" class="form-control" />
@Html.ValidationMessageFor(model => model.name, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-10">
<input type="text" name="phone" class="form-control" />
@Html.ValidationMessageFor(model => model.phone, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-10">
<textarea name="message" class="form-control"></textarea>
@Html.ValidationMessageFor(model => model.message, "", new { @class = "text-danger"})
</div>
</div>
<div class="form-group">
<div class="col-md-10">
<input type="submit" value="Send" class="btn btn-default"/>
</div>
</div>
</div>
}
I realize you can get Visual Studio to create everything for you, but I need to mix and match.