Display Date  in edit mode in asp.net mvc
Microsoft Net Framework

Display Date  in edit mode in asp.net mvc


1- In database table data type is Date e.g date_invoice
2- in DTO or class property is as below

   public DateTime date_invoice { get; set; }

3- in html view html is like this

                                   
 @Html.TextBoxFor(model => model.date_invoice, "{0:yyyy-MM-dd}", new { @class = "form-control", type = "date" })

Moslty Date is not dispalyed in edit mode reason is format of date that is  "{0:yyyy-MM-dd}" and type of box is date

  • Date issue in edit mode in asp.net mvc
  • Date formatting
  • Date format
  • Display date in edit mode.
     

Share This with your friend by choosing any social account


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM