Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I´m making an MVC4 site, now I just created a View that has a HolidayDate Field. And it is not showing in IE and shows horribly in Chrome with lots of glyphs inside the textbox. I want to do it in IE like how the shows in chrome. But I don't want JQuery to do it.


Here is how I defined that property in my model

C#
[Required]
 [DataType(DataType.Date)]
 [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
 [DisplayName("Holiday Date")]
 public virtual DateTime HolidayDate { get; set; }  



And in the View

HTML
 <div class="row">
            <div class="col-md-3">
                    @Html.LabelFor(m => m.HolidayDate) 
                    @Html.EditorFor(model => model.HolidayDate)            
                    @Html.ValidationMessageFor(model => model.HolidayDate)  
           </div>
</div>

And then how to get it to work on IE. Please anybody help
Posted
Updated 15-Oct-14 1:46am
v2
Comments
[no name] 15-Oct-14 7:49am    
When you are assigning the value in the Action to the Model, then Add
.ToString("format goes here")
Try with this once

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900