开发者

How to edit and display Date in ASP.Net MVC 2

开发者 https://www.devze.com 2022-12-26 08:14 出处:网络
I am storing a date in my database and want the user to be able to edit this date in the Edit View. In the past with ASP.Net web forms I have used 3 d开发者_开发问答ropdownlists for the Month, Day and

I am storing a date in my database and want the user to be able to edit this date in the Edit View. In the past with ASP.Net web forms I have used 3 d开发者_开发问答ropdownlists for the Month, Day and Year to get the date from the user and to bind it on display. I want to do the same in ASP.Net MVC and not sure how to do it?

I am not using any jQuery or Javascript, the design calls for simple postback.


Please don't do it the way you used to. Three different drop-downs is not very user friendly.

jQuery is in the MVC project template by default. You can get some really nice date selection experiences using plug-ins (such as the linked datepicker). There is lots of documentation on how to get this working (and its really easy) so google this first.


I found this blog that has pretty much what I had in mind and more examples for me to learn. Templated Helpers and Custom Model Binders in ASP.NET MVC 2

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号