Guest User

Untitled

a guest
Jun 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. ` public class Person
  2. {
  3. public int Id { get; set; }
  4.  
  5. [Required(ErrorMessage = "First name is required")]
  6. public string FirstName { get; set; }
  7. public string LastName { get; set; }
  8.  
  9. [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
  10. public DateTime? DateOfBirth { get; set; }
  11. }`
  12.  
  13. ` <div class="form-group">
  14. @Html.LabelFor(model => model.DateOfBirth, htmlAttributes: new { @class = "control-label col-md-2" })
  15. <div class="col-md-10">
  16. @Html.EditorFor(model => model.DateOfBirth, new { htmlAttributes = new { @class = "form-control" } })
  17. @Html.ValidationMessageFor(model => model.DateOfBirth, "", new { @class = "text-danger" })
  18. </div>
  19. </div>`
  20.  
  21. `@Html.EditorFor(model => model.DateOfBirth, new { htmlAttributes = new { @class = "form-control" } })`
  22.  
  23. `<script>
  24. $( function() {
  25. $( "#datepicker" ).datepicker();
  26. } );
  27. </script>
  28. <p>Date: <input type="text" id="datepicker"></p>`
Add Comment
Please, Sign In to add comment