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> |
I agree! Thank you! I just used the @type="date".
Thanks!
Thanks, you are life Saver
Thank you so much
Thanks for the help!!!
Dear team,
I need to implement datetime picker in MVC-Razor.
any bootstrap css is there for supporting Date-Time picker
Thanks a lot for this. It came very handy. But how can I refer to the values of model.start for future?
Thanks Friend for you Help.
Thank for this. I have been searching for ages how to do this with database first. Here it is !
Thank you Bro, in edit time do not auto-fill date I have wast one day but your code is work.
Gracias!
Thanks Friend for you Help.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! The
@Value
part made mine work!