可以在global文件中的application_error()中,记录用户操作中出现的异常日志
protected void Application_Error(Object sender, EventArgs e)
}
net的错误机制处理:
。<customErrors> 配置节支持内部 <error> 标记,该标记将 HTTP 状态代码与自定义错误页关联。例如:
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="/genericerror.htm"> <error statusCode="500" redirect="/error/callsupport.htm"/> <error statusCode="404" redirect="/error/notfound.aspx"/>
<error statusCode="403" redirect="/error/noaccess.aspx"/> </customErrors> </system.web></configuration>mode
mode:指示自定义错误是启用、禁用还是只向远程计算机显示。值:On、Off、RemoteOnly(默认值)。
相关文章: