在asp.net中阻止HTTP代码 [英] Prevent a HTTP code in asp.net

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

问题描述

如何防止asp.net中的HTTP链接....用于名称"字段,描述"字段等...

How to prevent a HTTP link in asp.net....for the Name field,description field etc...

推荐答案

我想您想阻止您的用户输入
I guess you want to prevent your users from entering something like
<a href="http://www.spammer.com">Great Spam</a> 


进入页面的某些文本文件.
您可以尝试以下操作:
-过滤掉任何<>通过JavaScript
-过滤掉任何<>在后面的代码中或将其更改为& lt;等
-尝试使用正则表达式进行更精细的解析以检测链接


into some text fileds of your pages.
There are some things you could try:
- filter out any <> by JavaScript
- filter out any <> in the code behind or change them to &lt; etc.
- try some more elaborate parsing with regular expressions to detect links


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

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