Author: Scott Hanselman's Computer Zen - ASP.NET | Posted on: 2/25/2009 5:10:21 PM | Views : 827

I've got this form for users to create an event. One of the fields is a DateTime, like this: And that's kind of lame as it's hard to type in a Date and a Time at the same time. It's also no fun. Most sites would have those separated, and ideally use some kind of Calendar Picker with jQuery or something. But when you post a form like this back to a Controller Action, it doesn't exactly line up neatly with a System.DateTime object. There's no clean way to get partials like this and combine them into a single DateTime. The "ViewModel" in doesn't match the Model itself. I could certainly make my method take two DateTimes, along with the other fields, then put them together later. It could get mess though, if...(read more) ...

Go to the complete details ...