MVC应用程序日历在IE中不起作用

时间:2019-03-10 00:12:46

标签: jquery html5 model-view-controller

我已经创建了MVC应用程序,在其中将日历添加到了文本框,并且该功能在Chrome中有效,但在IE中不起作用。这是代码。 HTML代码:-

<div class="row" style="padding-bottom: 5px;">
    <div class="col-xs-4 col-md-4">
        @Html.Label("Date of Request")
        <div class="input-group">
            <span class="input-group-addon"><span class="fa fa- 
calendar"></span></span>
            @Html.EditorFor(x => x.DateOfRequest, new {@class = "form- 
control", @placeholder = "Form Name", @title = "Form Name", type = 
"date"})
            @Html.ValidationMessageFor(m => m.DateOfRequest, "", new 
{@class = "text-danger"})
        </div>
        </div>

Model.cs

 [Display(Name = "Date Of Request")]
    [DataType(DataType.Date)]
    [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
    public DateTime? DateOfRequest { get; set; }

它正在Chrome,Edge中工作,但我需要使其在IE9,IE11中正常工作。我的组织仅使用IE。我尝试了一切,但没有任何效果。请帮忙。

1 个答案:

答案 0 :(得分:0)

 @Html.EditorFor(x => x.DateOfRequest, new {@class = "form-  control
 datepicker", @placeholder = "Form Name", @title = "Form Name", type = 
 "date"})

我在课堂上添加了datepicker,然后效果很好