文本区域中的换行符
这是我的代码
Controller
public ActionResult Sites()
{
var viewModel = new ViewModel();
viewModel.currentSite.genComments =HttpUtility.HtmlEncode("Some string that</br>\r\n looks like this<br/>");
return View(viewModel);
}
View:
@Html.EditorFor(v => v.currentSite.gencomments, Model.currentSite.gencomments, "gencomments")
我收到一条错误消息,指出路径中存在无效字符。 任何想法或建议
Here is my code
Controller
public ActionResult Sites()
{
var viewModel = new ViewModel();
viewModel.currentSite.genComments =HttpUtility.HtmlEncode("Some string that</br>\r\n looks like this<br/>");
return View(viewModel);
}
View:
@Html.EditorFor(v => v.currentSite.gencomments, Model.currentSite.gencomments, "gencomments")
I get an error saying that there are invalid characters in the path.
Any ideas or suggestions
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否打算让注释指定模板名称?看起来您正在调用 EditorFor 的此重载。
尝试仅
命名该字段,您可以尝试此操作(但不能保证这一点!):
Are you intending for the comments to specify the template name? It looks like you are calling this overload of EditorFor.
Try just
To name the field, you can try this (no guarantees on this one though!):