-
-
Save zeqk/657d1708764518949931158673c4c539 to your computer and use it in GitHub Desktop.
C# HTML5 input date datepicker MVC Razor
This file contains hidden or 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