zoukankan
html css js c++ java
一种简单的检测form非法字符串
protected
override
void
OnError(EventArgs e)
{
Exception lastException
=
this
.Server.GetLastError();
determin if it is HttpRequestValidationException
#region
determin if it is HttpRequestValidationException
if
( lastException
is
HttpRequestValidationException)
{
string
returnJS
=
string
.Format(
"
<script>alert('{0}');window.history.back();</script>
"
, Accor.Vel.CoreToolKit.Utilities.Language.GetResource(
"
InputError
"
,
this
.Page ) );
this
.Page.RegisterStartupScript( Guid.NewGuid().ToString().Replace(
"
-
"
,
""
), returnJS );
Response.Write( returnJS );
Server.ClearError();
return
;
}
}
在pagebase里面,catch住HttpRequestValidationException,处理一把就可以了~
查看全文
相关阅读:
语言基础
进制转换
添加
查找
继承
封装
面向基础 c#小复习
主外键
三个表的关系
插入信息,模糊查询,聚合函数,时间函数,排序,字符串函数,数学函数,求个数,球最大
原文地址:https://www.cnblogs.com/jinweijie/p/1219288.html
最新文章
在DataGridView_DragDrop事件中,确定DataGridView的单元格的位置
C# 一维数组
C# 类
C# for循环嵌套
C# 循环语句
C# 分支语句
C# 语言基础
进制转换
2016.7.27C#基础,数组
2016.7.24C#基础
热门文章
2016.7.25C#基础 类
2016.7.23C#语言基础 循环语句
out传值
特殊集合
集合
数组
类
for循环的镶嵌
循环
语句练习
Copyright © 2011-2022 走看看