Export (0) Print
Expand All

Page.ErrorPage Property

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

[Visual Basic]
Public Property ErrorPage As String
public string ErrorPage {get; set;}
public: __property String* get_ErrorPage();
public: __property void set_ErrorPage(String*);
public function get ErrorPage() : String;
public function set ErrorPage(String);

Property Value

The error page to which the browser is redirected.


[Visual Basic] 
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.
      this.ErrorPage = "Error_Page.aspx";

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

Page Class | Page Members | System.Web.UI Namespace

© 2014 Microsoft