Pravinkumar Birajdar

Pravinkumar Birajdar

  • 1.2k
  • 583
  • 108.4k

How to assign current date to strongly typed date property in a view?

Jun 17 2021 4:53 AM

How to assign current date to strongly typed date property in a view in asp.net mvc 5?

I have tried

 

and 

@Html.TextBoxFor(model=>model.Dated,new {@class="form-control",@type="date", @value = DateTime.Now.ToString("MM/dd/yyyy") })

and also tried from controller

but these are not working

Please help me...

 


Answers (4)