asp.net mvc - mvc 5 DateTime error -
i need save date webpage date , time, have error
the field filecreatedon must date" when try save data date , time ("2015-05-29 1:28:45 pm").
in db field datetime; description in model
public system.datetime filecreatedon { get; set; }
in edit.cshtml file:
@html.editorfor(model => model.filecreatedon , new { htmlattributes = new { @class = "form-control" } }) @html.validationmessagefor(model => model.filecreatedon , "", new { @class = "text-danger" })
i can read data db date , time ("2015-05-29 1:28:45 pm") have error if try save it.
you need make sure client side validators using cultures/globalization. if using jquery validate plugin mvc, see extension modify plugin meet needs: http://blog.icanmakethiswork.io/2012/09/globalize-and-jquery-validate.html
Comments
Post a Comment