Click here to Skip to main content
15,887,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting value from database as yyyy-MM-dd format only but it is throwing error in textboxfor


Error-

<"input class="form-control" id="DDL_AnalystReportsParentObj_createDate" name="DDL_AnalystReportsParentObj.createDate" type="date" value="11/24/2016">


The specified value "11/24/2016" does not conform to the required format, "yyyy-MM-dd".

What I have tried:

I tried to put
@Html.TextBoxFor(m => m.DDL_AnalystReportsParentObj.createDate, "{0:yyyy-MM-dd}" ,new { @type = "date", @class = "form-control" })
Posted
Updated 6-Feb-17 19:33pm

1 solution

 
Share this answer
 
Comments
Member 12986391 7-Feb-17 2:08am    
Thankyou Karthik it is working ...
Karthik_Mahalingam 7-Feb-17 2:09am    
welcome :)
Member 14007496 17-Jan-19 6:10am    
Thanks.it is nice for me.
Karthik_Mahalingam 17-Jan-19 6:32am    
Welcome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900