How to use Bootstrap 3 validation states with ASP.NET MVC Forms

added by DotNetKicks
2/16/2015 4:17:06 PM

2 Kicks, 507 Views

Recently, when writing code for my blog post on drop downs, “DropDownListFor with Dictionaries in ASP.NET MVC and why SelectList wants to kill you”, I stumbled over an interesting problem – when using ASP.NET MVC HTML helpers, such as @Html.TextBoxFor() and @Html.DropDownListFor() to render controls and @Html.ValidationMessageFor() to render validation error messages, I reaslised that ASP.NET MVC uses its own CSS classes, so no errors are getting highlighted when using Bootstrap 3.