I am currently using jQuery Date Time picker to select the date to add to the database. When using the date selection timer, the result is displayed correctly in the text field to which it is attached (IE 09/27/2009 16:00). However, the time of the date is not properly transmitted to the MVC application and is accepted as 01/01/0001 00:00:01.
This method requires one paramater - Match m. The page is strongly typed as a match.
<p> <label for="TimeAndDate">Time and date (click to reveal date and time picker):</label> <br /> <%= Html.TextBox("TimeAndDate") %> <%= Html.ValidationMessage("TimeAndDate", "*") %> </p> <script type="text/javascript"> $(function() { $('#TimeAndDate').datepicker({ duration: '', showTime: true, constrainInput: false }); }); </script>
For length, I omitted the script, included it above, but they are present on the page. Text field and validation fields were created by visual studio.
I have a feeling that I need to somehow implicitly convert a string into a text field into a DateTime object before passing it to the method, but I don't know how to do it.
Any help on this would be greatly appreciated.
Thanks Andy
Andy hunt
source share