Freigeben über


SPWebApplication.GetMappedPage-Methode (String)

Gibt den Speicherort der angepasste Anwendungsseite zurück.

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

Syntax

'Declaration
Public Function GetMappedPage ( _
    page As String _
) As String
'Usage
Dim instance As SPWebApplication
Dim page As String
Dim returnValue As String

returnValue = instance.GetMappedPage(page)
public string GetMappedPage(
    string page
)

Parameter

  • page
    Typ: System.String

    Der Speicherort der Standardseite Anwendung.

Rückgabewert

Typ: System.String
Der Speicherort der die angepasste Anwendungsseite. Andernfalls ein Nullverweis (Nothing in Visual Basic).

Beispiele

Das folgende Codebeispiel veranschaulicht, wie die benutzerdefinierte Seite Zuordnung basierend auf der Seite den Standardspeicherort-Anwendung abgerufen.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;

namespace MapCustomAppPage
{
    class Program
    {
        static void Main(string[] args)
        {
            using (SPSite site = new SPSite("https://localhost"))
            {
                //Get a reference to the web application.
                SPWebApplication webApp = site.WebApplication;

                //Output the custom application page location.
                Console.Out.WriteLine(webApp.GetMappedPage("/_layouts/accessdenied.aspx"));
               
                Console.Out.WriteLine("Press any key...");
                Console.ReadKey();
            }
        }
    }
}
Imports System
Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Administration
Module Module1

    Sub Main()

        Using site As New SPSite("https://localhost")

            'Get a reference to the web application.
            Dim webApp As SPWebApplication = site.WebApplication

            'Output the newly assigned application page.
            Console.Out.WriteLine(webApp.GetMappedPage("/_layouts/accessdenied.aspx"))

            Console.Out.WriteLine("Press any key...")
            Console.ReadKey()
        End Using

    End Sub

End Module

Siehe auch

Referenz

SPWebApplication Klasse

SPWebApplication-Member

GetMappedPage-Überladung

Microsoft.SharePoint.Administration-Namespace