I have a inputbox (text) that contains a datetime value, for some reason this input box has validation when I don't even require it.
My Model and ViewModel has no validation on the properites at all.
In my Razor view page I do have some input fields that have:
@Html.ValidationMessageFor(vm => vm.User.Age)
On this input I am trying to enter some string and it gives me a client-side validation warning:
@Html.TextBoxFor(vm => vm.User.BannedDate)
Below is the HTML that is rendered below the input box:
<input data-val="true" data-val-date="The field BannedDate must be a date." id="User_BannedDate" name="User.BannedDate" type="text" value="27/02/2014 12:00:00 AM" class="input-validation-error">
I am using Bootstrap, I have jquery also. Could it be detecting things automatically?
Update
Don't have a globalization tag in web.config
In my Controller's OnActionExecuting I am setting:
System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-CA");