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.

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

public string ErrorPage { get; set; }
/** @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.

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

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:
© 2014 Microsoft