System.Web.UI Namespace Page Class
Sets or retrieves the error page to which the requesting browser is redirected in the event of an unhandled page exception.
Inline |
<%@ Page ErrorPage = strFileUrl ... > |
Script |
Page.ErrorPage [ = strFileUrl ] |
strFileUrl |
String that specifies the URL of the error page to which the browser is redirected. |
The property is read/write with no default value.
NOTE: This property can also be set declaratively using the @ Page directive.
The following shows how to programmatically set the ErrorPage property at design time.
void Page_Load ( object src, EventArgs e ) {
if ( !IsPostBack ) {
this.ErrorPage = "myErrorPage.aspx";
}
}
Sub Page_Load ( Sender As Object, e As EventArgs )
If ( Not IsPostBack ) Then
Me.ErrorPage = "myErrorPage.aspx"
End If
End Sub |
|
C# |
VB |
Page Members @ Page