SPWebApplication.FileNotFoundPage property

Gets or sets the name of an HTML file relative to \\Program Files\Common Files\Microsoft Shared\web server extensions\14\LAYOUTS\Locale_ID that contains the error information that is used when a file cannot be found.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)


Public Property FileNotFoundPage As String
Dim instance As SPWebApplication
Dim value As String

value = instance.FileNotFoundPage

instance.FileNotFoundPage = value
public string FileNotFoundPage { get; set; }

Property value

Type: System.String
A string specifying the name of an HTML file that contains error information. If the value is a null reference (Nothing in Visual Basic) or an empty string, or if the file that is referred to does not exist, SharePoint Foundation returns a standard 404 response.


SharePoint Foundation does not support the custom error pages that are typically used in IIS applications. There can only be one file per SharePoint Web application, which must be in HTML and cannot contain dynamic ASP.NET controls.

See also


SPWebApplication class

SPWebApplication members

Microsoft.SharePoint.Administration namespace