我在 MVC4 Aspx 视图引擎中工作。在验证方法中,我返回了我想在多行中显示的错误消息。我尝试通过以下方式放置换行符,但它始终将其显示为字符而不是换行符。
我试图连接
<br>
\r\n
<br>
这是我的代码示例:
ErrorMessage = "Your password has not been updated. Passwords must contain:" + "<br>" +
"at least 8 characters<br/>" +
"one lower case and at least one upper case character" + "\r\n" +
"at least one number\r\n" +
"at least one non-alphanumeric (e.g. ! @ # $)\r\n" +
"no parts of the username longer than 2 characters";
请指导我所缺少的。