开发者

Newline in a <pre> element in internet explorer 7

I have the following code in my ASP.NET MVC 3 project:

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></开发者_StackOverflowscript>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>
...    
<pre>@Html.ValidationSummary()</pre>

The validationsummary shows the errormessages that are specified in my model. And the model gets the errormessages out of a resource file..

In 1 of the errormessages I use newlines (shift + enter).

These newlines are shown correctly in firefox and chrome, but not in internet explorer 7.

Can I fix this?


It's possible that the ValidationSummary() uses unix newlines (\n) and IE only likes the Windows newlines (\r\n). See if you can replace \n with \r\n in before displaying it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜