在asp.net文本框中允许html [英] Allow html in asp.net textboxes

查看:54
本文介绍了在asp.net文本框中允许html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面指令中放入了ValidateRequest ="false",但是页面的行为就像它没有回发一样.如果我删除了html,那么它会发回正常.

I put ValidateRequest="false" in my page directive but the page acts like it's not posting back. If I remove the html then it posts back fine.

使用更新面板中的文本框应该不会有所不同吗?

Using the text boxes inside an update panel shouldn't make a difference right?

我正在尝试将文本以html格式存储在数据库中.

I'm trying to store text in my database with html formatting.

同样,我正在使用更新面板.

Again, I am using an update panel.

推荐答案

您可能在后台遇到错误.如果您取出更新面板,会看到一个不错的YSOD吗?

You're probably getting an error behind the scenes. If you take out the update panel do you see a nice YSOD?

如果这是.Net 4.0应用程序,则即使您将ValidateRequest设置为false,也需要更改Web配置以允许使用不安全的字符.

If this is a .Net 4.0 application, you'll need to change the web config in order to allow for unsafe characters, even though you turned ValidateRequest to false.

必要的更改如下所示:< httpRuntime requestValidationMode ="2.0"/>

The requisite change looks like this: <httpRuntime requestValidationMode="2.0" />

这篇关于在asp.net文本框中允许html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆