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,处理一把就可以了~
查看全文
相关阅读:
Ajax缓存处理
单例模式
正则表达式基础
springmvc请求参数的绑定和获取
springmvc返回视图(解析)
RequestMapping请求映射方式
springmvc注解基本入门
springmvc简介
Mybatis入门-动态sql
Mybatis映射配置文件Mapper.xml详解
原文地址:https://www.cnblogs.com/jinweijie/p/1219288.html
最新文章
【性能优化】---懒加载---【巷子】
【ES6】001---module模块------【巷子】
localstorage
Service Fusing
2018年5大微服务发展趋势
deeplink
微服务架构~BFF和网关是如何演化出来的
Archimate
互联网后端基础设施
系统通知
热门文章
Architecture Patterns
谈谈架构的概念、架构的形式、架构设计原则
设计抗住千万级流量的架构思路
Java对象序列化与反序列化
Android 开发人员必须掌握的 10 个开发工具
Myeclipse中Tomcat的两种部署方式
Struts2 hibernate spring 概念总结
内容循环滚动的表格
SwfUpload文件上传
springMVC文件上传
Copyright © 2011-2022 走看看