加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc-2 – 如何通过ASP.NET MVC 2.0中的textarea接受html

发布时间:2020-12-16 06:30:43 所属栏目:asp.Net 来源:网络整理
导读:我正在使用ASP.net MVC 2.0,我在我的View上使用过textarea %= Html.TextAreaFor(m = m.Description,7,35,new { @class = "bg_area normal" })% 它在输入html数据之后提交表单时显示异常 pb hello world ! /b/p 有没有办法用textarea接受这种数据? 有没有办
我正在使用ASP.net MVC 2.0,我在我的View上使用过textarea

<%= Html.TextAreaFor(m => m.Description,7,35,new { @class = "bg_area normal" })%>

它在输入html数据之后提交表单时显示异常

<p><b> hello world ! </b></p>

有没有办法用textarea接受这种数据?

有没有办法从一个地方处理它,或者我必须添加

[ValidateInput(假)]

每个动作?

解决方法

我假设你得到了

A potentially dangerous Request.Form value was detected from the
client… exception. IF this is the case then you need to decorate your action result with

[ValidateInput(false)]

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读