【发布时间】:2015-08-04 08:24:19
【问题描述】:
在我的 web.config 中,我没有类似 CustomErrors 的内容。因为我希望一切都由 Global.asax 处理。
这是我的 web.config:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation targetFramework="4.5" debug="false"/>
<authentication mode="Forms" >
<forms loginUrl="login.aspx" name=".ASPNETAUTH" protection="None" path="/" timeout="20" >
</forms>
</authentication>
<httpRuntime requestPathInvalidCharacters="<,>,:,\,?" targetFramework="4.5" maxRequestLength="1048576"/>
<httpModules>
<add name="ImageResizingModule" type="ImageResizer.InterceptModule"/>
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="FormsAuthenticationModule" type="System.Web.Security.FormsAuthenticationModule"/>
<remove name="UrlAuthorization"/>
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule"/>
<add name="ImageResizingModule" type="ImageResizer.InterceptModule"/>
</modules>
<security>
<requestFiltering allowDoubleEscaping="true">
</requestFiltering>
</security>
</system.webServer>
</configuration>
这是 Global.asax 中的 Application_Error 事件:
void Application_Error(object sender, EventArgs e)
{
try
{
Response.Redirect("~/error.html");
}
catch
{
}
}
我需要 web.config 吗?
【问题讨论】:
标签: asp.net web-config global-asax imageresizer