IIS自定义错误VS Web.config自定义错误
大家好,
谁能解释(不给出多余的链接...),IIS自定义错误选项卡和web.config自定义错误部分之间的主要区别是什么,何时使用IIS自定义错误,何时使用web.config自定义错误?
谷歌让我知道.aspx文件不会在IIS中处理.是真的吗?为什么?
如果我们的应用程序中有任何html页面,并且此页面中发生了错误,该错误将由谁处理?
谢谢
Vinay
Hi All,
Can any one explain (with out giving unusefull links...) what is the main difference between IIS custom error tab and web.config custom error section and when we will use IIS custom errors and when we go for web.config custom error?
I came to know by google that .aspx files will not be handled in IIS..is it true?why?
If we have any html page in our application and an error occured in this page which one will handle this?
Thanks
Vinay
Vinay,
Hi Vinay,
IIS Custom errors are Error messages for HTTP Errors some of them are as below
200 - OK
400 - Bad request
401 - Access denied
401.1 - Logon failed
403.1 - Execute access forbidden
404.0 - (None) – File or directory not found
Web.Config自定义错误消息是三种类型的
Web.Config Custom error messages are of three types
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors defaultRedirect="url"
mode="On|Off|RemoteOnly">
<error statusCode="500"
redirect="InternalError.htm"/>
</customErrors>
</system.web>
</configuration>
如果模式"为关闭",则这指定禁用自定义错误.这样可以显示详细的ASP.net错误.
如果模式"为开",则这指定启用自定义错误.如果未指定 defaultRedirect ,则用户会看到一般的ASP.NET错误
如果模式"为远程",则这指定自定义错误仅显示给远程客户端,而ASP.NET错误则显示给本地主机.这是默认设置.
defaultRedirect :指定在发生错误时将浏览器定向到的默认URL.如果未指定defaultRedirect,则会显示一般错误
If Mode is OFF then this specifies that custom errors are disabled. This allows display of detailed ASP.net errors
If Mode is ON then this specifies that custom errors are enabled. If no defaultRedirect is specified, users see a generic ASP.NET error
If Mode is Remote then this specifies that custom errors are shown only to remote clients and ASP.NET errors are shown to the local host. This is the default.
defaultRedirect :Specifies the default URL to direct a browser to if an error occurs. When defaultRedirect is not specified, a generic error is displayed instead