aspxでエラーを表示させない
aspxページでエラーになると味気ないエラーページが表示されますが、
これはページの閲覧者にとっては非常に不親切なものです。
これを通常はweb.configで
<customErrors defaultRedirect="500.htm" mode="RemoteOnly">
<error statusCode="500" redirect="./SystemFiles/500.htm"/>
</customErrors>
などとしてカスタムのエラーページへリダイレクトしますが、
エラーページを作っていなくても、
「味気ない」エラーページよりは空白ページが表示されたほうがまだいい。
といった場合は以下の様にします。
Private Sub Page_Error(ByVal sender As Object, ByVal e As System.EventArgs) Handles
MyBase.Error
Server.ClearError()
End Sub
これでページのエラーはクリアされて、空白のページが表示されます。
記事id:35 / 4156PV
関連記事
Warning: simplexml_load_file() [
function.simplexml-load-file]: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in
/home/session-2/www/02_zatu/system_files/core_sys.php on line
41
Warning: simplexml_load_file(http://www.jigen.xyz/index.xml) [
function.simplexml-load-file]: failed to open stream: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in
/home/session-2/www/02_zatu/system_files/core_sys.php on line
41
Warning: simplexml_load_file() [
function.simplexml-load-file]: I/O warning : failed to load external entity "http://www.jigen.xyz/index.xml" in
/home/session-2/www/02_zatu/system_files/core_sys.php on line
41
Warning: Invalid argument supplied for foreach() in
/home/session-2/www/02_zatu/system_files/core_sys.php on line
42