PublishingService.CreatePageLayout método
Cria um novo objeto de PageLayout .
Namespace: Microsoft.SharePoint.Publishing.WebServices
Assembly: Microsoft.SharePoint.Publishing (em Microsoft.SharePoint.Publishing.dll)
Sintaxe
'Declaração
<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.StringNome do arquivo do novo layout de página. Ele deve ter uma extensão. aspx. Ele não deve incluir o caminho para o arquivo.
associatedContentTypeId
Tipo: System.StringAssociados a cadeia de caracteres de identificação de tipo de conteúdo.
title
Tipo: System.StringValor de seqüência de caracteres opcional especificando o título do layout da página. Esse parâmetro pode ser uma referência nula (Nothing no Visual Basic).
description
Tipo: System.StringValor de seqüência opcional especifica a descrição do layout de página. Esse parâmetro pode ser uma referência nula (Nothing no Visual Basic).
siteUrl
Tipo: System.StringURL absoluta do site. O layout da página é criado na Galeria de layouts de página na Web raiz do site especificado.
Valor retornado
Tipo: System.String
Uma seqüência de caracteres que contém o URL absoluto do novo objeto de PageLayout .
Exemplos
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