Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ` public class Person
- {
- public int Id { get; set; }
- [Required(ErrorMessage = "First name is required")]
- public string FirstName { get; set; }
- public string LastName { get; set; }
- [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
- public DateTime? DateOfBirth { get; set; }
- }`
- ` <div class="form-group">
- @Html.LabelFor(model => model.DateOfBirth, htmlAttributes: new { @class = "control-label col-md-2" })
- <div class="col-md-10">
- @Html.EditorFor(model => model.DateOfBirth, new { htmlAttributes = new { @class = "form-control" } })
- @Html.ValidationMessageFor(model => model.DateOfBirth, "", new { @class = "text-danger" })
- </div>
- </div>`
- `@Html.EditorFor(model => model.DateOfBirth, new { htmlAttributes = new { @class = "form-control" } })`
- `<script>
- $( function() {
- $( "#datepicker" ).datepicker();
- } );
- </script>
- <p>Date: <input type="text" id="datepicker"></p>`
Add Comment
Please, Sign In to add comment