Compartir a través de


del método PublishingService.CreatePageLayout

Crea un nuevo objeto PageLayout .

Espacio de nombres:  Microsoft.SharePoint.Publishing.WebServices
Ensamblado:  Microsoft.SharePoint.Publishing (en Microsoft.SharePoint.Publishing.dll)

Sintaxis

'Declaración
<WebMethodAttribute> _
Public Function CreatePageLayout ( _
    pageLayoutName As String, _
    associatedContentTypeId As String, _
    title As String, _
    description As String, _
    siteUrl As String _
) As String
'Uso
Dim instance As PublishingService
Dim pageLayoutName As String
Dim associatedContentTypeId As String
Dim title As String
Dim description As String
Dim siteUrl As String
Dim returnValue As String

returnValue = instance.CreatePageLayout(pageLayoutName, _
    associatedContentTypeId, title, _
    description, siteUrl)
[WebMethodAttribute]
public string CreatePageLayout(
    string pageLayoutName,
    string associatedContentTypeId,
    string title,
    string description,
    string siteUrl
)

Parámetros

  • pageLayoutName
    Tipo: System.String

    Nombre de archivo del nuevo diseño de página. Debe tener una extensión .aspx. No debe incluir la ruta de acceso al archivo.

  • associatedContentTypeId
    Tipo: System.String

    Cadena de identificador de tipo de contenido de asociados.

  • title
    Tipo: System.String

    Valor de cadena opcional especifica el título del diseño de la página. Este parámetro puede ser una referencia null (Nothing en Visual Basic).

  • description
    Tipo: System.String

    Valor de cadena opcional especifica la descripción del diseño de página. Este parámetro puede ser una referencia null (Nothing en Visual Basic).

  • siteUrl
    Tipo: System.String

    Dirección URL absoluta del sitio. El diseño de página se crea en la Galería de diseño de página en la raíz Web del sitio especificado.

Valor devuelto

Tipo: System.String
Una cadena que contiene la dirección URL absoluta del nuevo objeto PageLayout .

Ejemplos

using System;
using System.Net;
using PublishingServiceUtility.PublishingWebService;

namespace PublishingServiceUtility
{
    public class Program
    {

        internal static void CreatePressReleasePageLayout()
        {
            // Add a Web reference to the Web service located at "http://<yourserver>/<yoursite>/_vti_bin/PublishingService.asmx"
            // using the name PublishingWebService and Visual Studio to generate the PublishingService proxy object.

            // Create and initialize the PublishingService proxy object.
            PublishingService publishingService = new PublishingService();
            publishingService.Url = "http://<yourserver>/<yoursite>/_vti_bin/PublishingService.asmx";
            publishingService.AllowAutoRedirect = false;

            // This sample uses the credentials of the current user. If you want to use the credentials of a different user
            // then create a new NetworkCredential instance and use that instead of the DefaultCredentials used here.
            publishingService.Credentials = CredentialCache.DefaultCredentials;

            // Create the press release page layout.
            publishingService.CreatePageLayout("PressReleaseSmallImage.aspx",
                "0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D",
                "Press Release with Small Image", "This page layout is for press releases that need a small image at the top",
                "http://<yourserver>/<yoursite>");
        }

        public static void Main(string[] arguments)
        {
            CreatePressReleasePageLayout();
        }

    } // class Program

Vea también

Referencia

clase PublishingService

Miembros PublishingService

Espacio de nombres Microsoft.SharePoint.Publishing.WebServices

PublishingService