I have a form generated by Razor that allows users to edit some scheduler data, and it works fairly well.
One thing that I do not understand, nor have I seen before, are the Date and Time pickers that are automatically generated by Razor.
To clarify, these are what I'm talking about:
They're nice and all, but as you can see in the screenshot, they do not use my model values.
The markup itself has my values set in the tags, but the controls ignore them.
Here's what I mean:
As you can see, the values are set in the tags, but the controls are not respecting those values.
I will note that in my custom-built model, I have these properties annotated with the following:
//For the dates...
[DataType(System.ComponentModel.DataAnnotations.DataType.Date)]
//For the time...
[DataType(System.ComponentModel.DataAnnotations.DataType.Time)]
I would prefer to not have to remove these annotations, however if it affects my reaching a solution, I will do what must be done.
To solve this, I'd like one of two things:
- Prevent these controls from being generated in the first place so that I can use this absolutely wonderful jQuery datetimepicker addon.
- Force these controls to respect and display the values passed in from my model.
All suggestions are appreciated. Suggestions made by those familiar with MVC will be appreciated even more.