Created
July 20, 2017 01:24
-
-
Save badcommandorfilename/118012102de8e7201e079e519ee9d135 to your computer and use it in GitHub Desktop.
C# HTML5 input date datepicker MVC Razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- How to insert a date editor in a Razor view --> | |
<div class="form-group"> | |
@Html.LabelFor(model => model.Start, htmlAttributes: new { @class = "control-label col-md-2" }) | |
<div class="col-md-10"> | |
@Html.TextBoxFor(model => model.Start, new { @type="date", @class = "form-control datepicker", @Value = Model.Start.ToString("yyyy-MM-dd") } ) | |
@Html.ValidationMessageFor(model => model.Start, "", new { @class = "text-danger" }) | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!