NewWebPage Method
NewWebPage Method

Creates a new Web Part Page or a new basic page in the specified document library.

<Method ID="Text">
  <SetList Scope="Request">GUID</SetList>
  <SetVar Name="Cmd">NewWebPage</SetVar>
  <SetVar Name="ID">New</SetVar>
  <SetVar Name="Type">[WebPartPage|BasicPage]</SetVar>
  <SetVar Name="WebPartPageTemplate">[1-8]</SetVar>
  <SetVar Name="Overwrite">[true|false]</SetVar>
  <SetVar Name="Title">Text</SetVar>
</Method>

Parameters

Parameter Description

ID = "Text"

Application-specific string. In an HTML editor compatible with Windows SharePoint Services, such as Microsoft Office SharePoint Designer 2007, the string provides the sequence number and name of the method.

Scope = "Request"

When set to Request, the Scope attribute sets the variable for the scope of the enclosing Method element, unless the variable is changed by another tag.

Name = "Cmd"

Must be set to NewWebPage.

Name = "ID"

Must be set to New.

Name = "Type"

Specifies the type of Web page to create. Possible values include WebPartPage and BasicPage. A Web Part Page contains multiple Web Part zones and allows different Web Parts to be added to each zone on the page, while a basic page has only one zone and by default contains a Content Editor Web Part.

Name = "WebPartPageTemplate"

Specifies the template to use for the Web Part Page. Possible values, listed in the following table, correspond to layout templates shown on the New Web Part Page.

This parameter is ignored for basic pages.

Value Description
1 Full Page, Vertical
2 Header, Footer, 3 Columns
3 Header, Left Column, Body
4 Header, Right Column, Body
5 Header, Footer, 2 Columns, 4 Rows
6 Header, Footer, 4 Columns, Top Row
7 Left Column, Header, Footer, Top Row, 3 Columns
8 Right Column, Header, Footer, Top Row, 3 Columns

Name = "Overwrite"

Specifies true to overwrite any file of the same name that exists; otherwise, false.

Name = "Title"

Specifies the file name of the new Web page. For a Web Part Page, also specifies the title that is displayed on the page.

Decoded

<Method ID="0,NewWebPage">
  <SetList Scope="Request">6beeefcd-866d-4fc7-94b9-
    94e6297386bc</SetList>
  <SetVar Name="Cmd">NewWebPage</SetVar>
  <SetVar Name="ID">New</SetVar>
  <SetVar Name="Type">WebPartPage</SetVar>
  <SetVar Name="WebPartPageTemplate">3</SetVar>
  <SetVar Name="Overwrite">true</SetVar>
  <SetVar Name="Title">Text</SetVar>
</Method>
Return Value

Success

Returns the code attribute, which is a signed-decimal representation of an HRESULT, such as <Result ID="0,NewWebPage" Code="0" />.

Error

Returns an XML-encoded Unicode (UTF-8) text string. For more information, see Error Message Format for Windows SharePoint Services.

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View