@model MvcRequiredCheckbox.SampleViewModel
<title>ASP.NET MVC - Required Checkbox with Data Annotations</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
.field-validation-error {
<div class="col-md-6 col-md-offset-3">
<h1>ASP.NET MVC - Required Checkbox with Data Annotations</h1>
@using (Html.BeginForm())
@Html.CheckBoxFor(x => x.TermsAndConditions)
@Html.LabelFor(x => x.TermsAndConditions)
@Html.ValidationMessageFor(x => x.TermsAndConditions)
<button type="submit" class="btn btn-success submit">Submit</button>
<div class="credits text-center">
<a href="http://jasonwatmore.com/post/2013/10/16/ASPNET-MVC-Required-Checkbox-with-Data-Annotations.aspx">ASP.NET MVC - Required Checkbox with Data Annotations</a>
<a href="http://jasonwatmore.com">JasonWatmore.com</a>