Sto facendo una semplice applicazione Internet MVC4, che consente di aggiungere alcuni elementi alle categorie.La data del campo deve essere una data in mvc in chrome
Ecco cosa ho fatto finora.
Ho un datapicker in visualizzazione mvc. Lo script per il datepicker è come questo.
<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.20.min.js")" type="text/javascript"></script>
@Scripts.Render("~/bundles/jqueryval")
<script type="text/javascript">
$(function() {
$('#dtItemDueDate').datepicker({
dateFormat: 'dd/mm/yy',
minDate: 0
});
});
</script>
La mia proprietà modello:
[DisplayName("Item DueDate")]
[Required]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}",ApplyFormatInEditMode = true)]
[DataType(DataType.DateTime)]
public DateTime? dtItemDueDate { get; set; }
public char charCompleted { get; set; }
e, a mio avviso ho fatto questo:
@Html.TextBoxFor(m => m.dtItemDueDate)
@Html.ValidationMessageFor(m => m.dtItemDueDate)
L'errore è simile a questo:
The field Item DueDate must be a date.
La strana questo è che funziona in IE e Mozilla, ma non funziona funziona in Chrome.
ho trovato molti post su SO, ma nessuno di loro aiutano
Tutte le idee/suggerimenti?
È lo stesso problema? http://stackoverflow.com/questions/5966244/jquery-datepicker-chrome –
@RowanFreeman yes rowan. Esaminerò la risposta –
@ RowanFreeman sorbo grazie. Funziona. Si prega di inviare la risposta in questo post anche qui. Il collegamento potrebbe rompersi in qualsiasi momento .. Grazie un milione –