datatype.date注释未在Firefox中显示日历 [英] datatype.date annotation not showing calendar in firefox
问题描述
我有一个带有日期字段的模型,并用以下注释:
I have a model with a date field and I've annotated it with:
[DataType(DataType.Date)]
这样做之后,当我进入视图并单击输入框时,下面会显示一个日历,我可以在其中选择日期.可以在Chrome浏览器中使用,但在Firefox中无法显示日历,这是修复程序的常见问题吗?
after doing this when I go into the view and click on the input box, a calendar shows up underneath, where I can pick a date. This works in Chrome but in firefox the calendar doesn't show up, is this a common problem with a fix?
推荐答案
据我了解,您使用EditorFor帮助程序为模型生成HTML.正如John所写-它取决于浏览器,因此不可靠.但是,您可以使用编辑器模板来自定义为模型生成的HTML.我个人认为最好的解决方案是jQuery日期选择器.
As far as I understand you use EditorFor helper to generate HTML for a model. As John wrote - it depends on browser so it's not reliable. However you can use editor templates to customize the HTML generated for your models. Personally I think the best solution will be jQuery date picker.
这篇关于datatype.date注释未在Firefox中显示日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!