I'm working on a application who run on IE8 and one of is page use @Html.raw to render and exception when a model got some errors.
Here is a snipet of the code :
@Html.LabelFor(model => model.Fonds)
@Html.EditorOrDisplayFor(model => model.Fonds)
@Html.Raw(!Model.IsFondsValid ? "<span class=\"field-validation-error\"> </span>" : "")
And the Css :
span.field-validation-error
{
background-image: url('Images/error.png');
background-repeat: no-repeat;
color: transparent;
background-size: 16px 16px;
height: 20px;
line-height: 20px;
font-size: 20px;
content: " ";
width:20px;
overflow:hidden;
display:inline-block;
vertical-align: middle;
}
If a probleme occure on the property Fonds, the span will be display with its icone and as soon i want to do any modification to correct this error, IE8 show me a message box asking me to reload the page in a compatible mode.
Do you have any ideas why such behavior ?
Thank you.
Note : If i change the CSS file and put the display style for "display:block" IE does not ask me anymore for a reload of my page in a compatible mode. Strange behavior, that i don't understand.