异常详细信息: System.Web.HttpRequestValidationException: 从客户端(tbName="';--<script language="ja...")中检测到有潜在危险的 Request.Form 值。
上面这个错误的解决办法在以下代码中:
或在web.config配置文件中加入如下代码:
上面这个错误的解决办法在以下代码中:
<%
@ Page validateRequest="false" language="c#" Codebehind="01Input.aspx.cs" AutoEventWireup="false" Inherits="CommandExample.login"
%>
加入validateRequest="false"或在web.config配置文件中加入如下代码:
<?
xml version="1.0"
?>
< configuration >
< system .web >
< compilation defaultLanguage ="C#" debug ="true" >
< compilers >
< compiler language ="c#" type ="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" extension =".cs" compilerOptions ="/d:DEBUG;TRACE" /></ compilers ></ compilation >
< pages validateRequest ="false" enableSessionState ="true" enableViewState ="true" />
----------------------------------------------------------------------------------------------------------------------
< customErrors defaultRedirect ="error.htm" mode ="Off" />
< globalization fileEncoding ="gb2312" requestEncoding ="gb2312" responseEncoding ="gb2312" culture ="zh-CN" />
< xhtmlConformance mode ="Legacy" /></ system.web >
</ configuration >
带横线的那句,给网站所有的页面配置成validateRequest="false".
< configuration >
< system .web >
< compilation defaultLanguage ="C#" debug ="true" >
< compilers >
< compiler language ="c#" type ="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" extension =".cs" compilerOptions ="/d:DEBUG;TRACE" /></ compilers ></ compilation >
< pages validateRequest ="false" enableSessionState ="true" enableViewState ="true" />
----------------------------------------------------------------------------------------------------------------------
< customErrors defaultRedirect ="error.htm" mode ="Off" />
< globalization fileEncoding ="gb2312" requestEncoding ="gb2312" responseEncoding ="gb2312" culture ="zh-CN" />
< xhtmlConformance mode ="Legacy" /></ system.web >
</ configuration >