允许在文本框中asp.net的MVC的html [英] allow html in text boxes asp.net mvc
本文介绍了允许在文本框中asp.net的MVC的html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用asp.net mvc的IM ...
我怎么能允许用户输入HTML到一个文本框...
IM塞汀validaterequest为false,但还是收到此错误:
im using asp.net mvc... how can I allow users to enter html into a textbox... im seting validaterequest to false and still getting this error:
从客户端检测到有潜在危险的Request.Form值(摘要=< A>
)。
A potentially dangerous Request.Form value was detected from the client (Summary="<a>
").
我知道它不是推荐等,但它是供内部使用。
i know its not recommended etc, but it's for internal use.
推荐答案
的 ValidateInput(假)
属性添加到你的动作
[ValidateInput(false)]
public ActionResult MyAction (int id, string content) {
}
这篇关于允许在文本框中asp.net的MVC的html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文