I could be wrong, but the only way I know is to use Application_Error in global.asax, you can test e.Message to see if it contains something like "max request length" exceeded
我想上传文件的出错应该是在machine.config级别。 无法运行到application这个级别。 错误在application_error前就发生了。我不知道如何去解决。btw:thank ur reply!
<configuration>
<system.web>
<customErrors defaultRedirect="error.aspx"
mode="RemoteOnly">
<error statusCode="500"
redirect="error.aspx"/>
</customErrors>
</system.web>
</configuration>
2. error.aspx:
error3. testerror.aspx:
<script language="C#" runat="Server">
void Page_Load(Object sender, EventArgs e)
{
throw new Exception("whatver");
}
</script>
也就是根本等不到
global.asax
protected void Application_Error(Object sender, EventArgs e)
{
Response.Redirect("err.aspx");
}
发生.思归,各位大虾能否给点提示?
无法运行到application这个级别。
错误在application_error前就发生了。我不知道如何去解决。btw:thank ur reply!
我刚才查了微软的新闻组。
asp.net上传是放到内存,既然住留内存,又和CLR机制有关系。我不知道如何来处理CLR的错误机制。