SPWebApplication.GetMappedPage - Méthode (SPWebApplication.SPCustomPage)

Retourne l'emplacement de la page d'application personnalisée.

Espace de noms :  Microsoft.SharePoint.Administration
Assembly :  Microsoft.SharePoint (dans Microsoft.SharePoint.dll)

Syntaxe

'Déclaration
Public Function GetMappedPage ( _
    key As SPWebApplication.SPCustomPage _
) As String
'Utilisation
Dim instance As SPWebApplication
Dim key As SPWebApplication.SPCustomPage
Dim returnValue As String

returnValue = instance.GetMappedPage(key)
public string GetMappedPage(
    SPWebApplication.SPCustomPage key
)

Paramètres

Valeur renvoyée

Type : System.String
L'emplacement de la page d'application personnalisée. Dans le cas contraire, une référence Null (Rien dans Visual Basic).

Exemples

L'exemple de code suivant montre comment récupérer le mappage de page d'application à l'aide d'un objet d'énumération SPWebApplication.SPCustomPage .

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

namespace GetCustomAppPage
{
    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 name of the custom application page.
                Console.Out.WriteLine(webApp.GetMappedPage(SPWebApplication.SPCustomPage.AccessDenied));
                
                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(SPWebApplication.SPCustomPage.AccessDenied))

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

    End Sub

End Module

Voir aussi

Référence

SPWebApplication classe

SPWebApplication - Membres

GetMappedPage - Surcharge

Microsoft.SharePoint.Administration - Espace de noms