共用方式為


UnsecuredLayoutsPageBase Class

Represents the base class for application pages that explicitly do not require the user to have any permissions, such as the access denied page.

Inheritance Hierarchy

System.Object
  System.Web.UI.Control
    System.Web.UI.TemplateControl
      System.Web.UI.Page
        Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase
          Microsoft.SharePoint.WebControls.LayoutsPageBase

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _
<PermissionSetAttribute(SecurityAction.LinkDemand, Name := "FullTrust")> _
Public Class UnsecuredLayoutsPageBase _
    Inherits Page
'Usage
Dim instance As UnsecuredLayoutsPageBase
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
public class UnsecuredLayoutsPageBase : Page

Remarks

In general, use UnsecuredLayoutsPageBase as a base class for pages to which even unauthenticated users must have access, such as a login page.

For a page base control to which access can be limited to users who possess certain rights, use LayoutsPageBase.

Typically, a class is created in a code behind the file (.aspx.cs) that derives from UnsecuredLayoutsPageBase. The .aspx file, in turn, inherits from the custom page class. For example, the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS\login.aspx page that ships with Microsoft SharePoint Foundation 2010 inherits from an internal class named LoginPage, which itself inherits from UnsecuredLayoutsPageBase.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

UnsecuredLayoutsPageBase Members

Microsoft.SharePoint.WebControls Namespace