ViewBag.Title = "HtmlHelperDemo";
<h3>Student Data Form</h3>
<div class="form-horizontal">
@using (Html.BeginForm("UserRegistration", "Students"))
@Html.Label("User Name", new { @class = "control-label col-sm-2" })
@Html.TextBox("username", null, new { @class = "form-control" })
@Html.Label("Email ID", new { @class = "control-label col-sm-2" })
@Html.TextBox("email", null, new { @class = "form-control" })
@Html.Label("Gender", new { @class = "control-label col-sm-2" })
Male @Html.RadioButton("Gender", "male")
Female @Html.RadioButton("Gender", "female")
@Html.Label("Courses", new { @class = "control-label col-sm-2" })
C# @Html.CheckBox("C#", new { value = "C#" })
ASP.NET @Html.CheckBox("ASP.NET", new { value = "ASP.NET" })
ADO.NET @Html.CheckBox("ADO.NET", new { value = "ADO.NET" })
@Html.Label("Contact", new { @class = "control-label col-sm-2" })
@Html.TextBox("contact", null, new { @class = "form-control" })
<div class="col-sm-2"></div>
<input type="submit" value="submit" class="btn btn-primary" />