Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ErrorPage Property

Page.ErrorPage Property

Gets or sets the error page to which the requesting browser is redirected in the event of an unhandled page exception.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

'Declaration
Public Property ErrorPage As String
'Usage
Dim instance As Page
Dim value As String

value = instance.ErrorPage

instance.ErrorPage = value
/** @property */
public String get_ErrorPage ()

/** @property */
public void set_ErrorPage (String value)

public function get ErrorPage () : String

public function set ErrorPage (value : String)

Not applicable.

Property Value

The error page to which the browser is redirected.

Sub Page_Load(Sender As Object, e As EventArgs)

   ' Note: This property can also be set in <%@ Page ...> tag.
   If (Not IsPostBack) Then
      Me.ErrorPage = "Error_Page.aspx"
 End If
End Sub

void Page_Load(Object sender, EventArgs e)
{
    // Note: This property can also be set in <%@ Page ...> tag.
    if(!get_IsPostBack())
        this.set_ErrorPage("Error_Page.aspx");
} //Page_Load

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2015 Microsoft