Name
IsCustomErrorEnabled
Synopsis
Boolean = Context.IsCustomErrorEnabled
Returns a Boolean value specifying whether custom errors are enabled for the current request.
Parameters
-
Boolean
A Boolean variable to receive the value of this property.
Example
The following example displays True
if custom
errors are enabled; otherwise, it displays False
.
Sub Page_Load( ) Message.Text = "Custom Error Enabled?" & _ Context.IsCustomErrorEnabled End Sub
Notes
This flag is controlled by the customErrors
section in web.config
. If the
customErrors
element’s
mode
attribute is set to On
,,
IsCustomErrorEnabled returns True
. If the
customErrors
element’s
mode
attribute is set to False
or RemoteOnly
, this flag is
False
.
Get ASP.NET in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.