This article contains information about how to add a Web Part to a Web Part Page.
Web Parts are components that enable non-programmers to gather information they care about and customize the appearance of web pages.
To add a web part to a web part page, follow the steps below.
Before you begin:
- Create a site on your portal named “WebPartSite”.
- Create a web part page named “MyWebPartPage” in the Shared Documents document library. Set its layout template to “Header, Footer, and 3 Columns”.
Steps:
- Open Kivati Studio and create new blank project.
- Add an Open Site task to your project and set the property WebUrl to “WebPartSite”. You can find this task under the site category in the WSS task library.
- Add an Open Web Part Page task to your project and set PageUrl = full path of the Web part page in the site (for example: / WebPartSite/Shared%20Documents/ MyWebPartPage.aspx). You can find this task under the Web Part category in the WSS task library.
- On the task added in step 3, chain the NewWebReference property from the Open Site task to the WebReference property on the Open Web Part Page task. Create a dependency from the Open Site task to the Open Web Part Page task.
- Add an Open Web Part Manager task to your project. You can find this task under the Web Part category in the WSS task library.
- On the Open Web Part Manager task, chain the Page property from the Open Web Part Page task to the Page property on the Open Web Part Manager task. Create a dependency from the Open Web Part Page task to the Open Web Part Manager task.
- Add an Add Web Part task to your project. You can find this task under the Web Part category in the WSS task library. Set the following property values:
- DwpData = Path of *.dwp file. This can be a project resource.
- DwpDataEncoded = true if the DwpData is Base64-encoded; false otherwise.
- ZoneID = TopColumnZone
- ZoneIndex = 0
- Build and execute your project.
For more information about adding a Web Parts to a Web Part page, see the SharePoint SDK and documentation.