Adding webpart to page with feature in sharepoint

No.of Views2039
Bookmarked1 times
Downloads 
Votes0
By  André Lage   On  10 Jun 2010 09:06:01
Tag : SharePoint , Setup, Upgrade, Administration and Operation
In this article I demonstrate how we can use the Configuration files "Elements.xml" to add pages with webparts for the Sharepoint sites without having to make a line of code.
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

Hello, spent more than 1 year, Sharepoint 2010 is to come into force, many presentations from Microsoft "Sharepoint Road to 2010 ', but before you start doing articles on Sharepoint 2010, I recommend you take it easy, the product will still take some time to get to 100% until we are learning and it will soon launch a series of articles related to Sharepoint 2010, while it can revise a little basis exists for Sharepoint.
In this article I demonstrate how we can use the Configuration files "Elements.xml" to add pages with webparts for the Sharepoint sites without having to make a line of code. :)

Setting WebPart to import

Before creating our solution can begin to set our parameters and the WebPart which is going to receive.When configured, we can accomplish the export of our webpart through the option "Export"Menu of the Webpart. 

Image Loading

After you export the webpart to the format "*. dwp" or "*. webpart" we can open the file in Notepad format, where we can visualize the structure of our Webpart and parameters that it receives. 

Image Loading

Configure Visual Studio Solution

Feature configuration file with file support "elements.xml"to the Page Setup and Webpart. 

Image Loading

Elements.xml file where is defined in the configuration page to be imported into the SharePoint site and between properties of the page to add it to Webpart. Title to "AllUsersWebPart"serving to define the structure and Webpart zone to be added.

WebPartZoneID: WebPart zone of your page where you will add the Webpart;

WebPartOrder: The order of entry of the WebPart;
<! [CDATA ["Structure Webpart" we can copy the contents of the exported file of *. webpart, DWP * 

Image Loading

Feature Activation

After installing the WSP solution in Sharepoint Farm and enable the solution in the SharePoint site, activating the Feature 'Add Webpart to page "to copy a page and add the Webpart previously configured. 

Image Loading

The "ReportGeral"was copied to the site and added the Sharepoint Webpart with the settings previously defined. 

Image Loading

Conclusion

Done, we can configure our webparts and previously held the Deploy a SharePoint site included pages with webpart, without making a line of code.

 
Sign Up to vote for this article
 
About Author
 
André Lage
Occupation-Not Provided
Company-Not Provided
Member Type-Senior
Location-Portugal
Joined date-09 Jun 2010
Home Page-Not Provided
Blog Page-Not Provided
 
 
Other popularSectionarticles
Comments
By:eDate Of Posted:4/12/2012 12:05:20 AM
s
sdgggfg
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top