我有一个 MVC3 C#.Net 网络应用程序。我正在循环一个数据表。有些行导入正常,有些行不正常。我想以列表格式将错误列表发送回视图。我将以下文本分配给 ViewBag 属性
Input error on Row(1) Cell(3) Input string was not in a correct format.<br/> Input error on Row(4) Cell(3) Input string was not in a correct format.<br/>
我希望 br 会在 HTML 中写一个换行符。它不是。我希望错误消息看起来像这样
Input error on Row(1) Cell(3) Input string was not in a correct format.
Input error on Row(4) Cell(3) Input string was not in a correct format.
有任何想法吗?