Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web parts for SharePoint. What’s a web part? Application that can be added to a page with a web part zone. Inhierits from web controls Can be developed.

Similar presentations


Presentation on theme: "Web parts for SharePoint. What’s a web part? Application that can be added to a page with a web part zone. Inhierits from web controls Can be developed."— Presentation transcript:

1 Web parts for SharePoint

2 What’s a web part? Application that can be added to a page with a web part zone. Inhierits from web controls Can be developed using C# or VB The concept of web parts are not just for SharePoint

3 Web part lifecycle Without postbackWith postback OnInit OnLoad CreateChildControls OnPreRender Render OnInit CreateChildControls OnLoad OnPreRender Render

4 OnInit Used to initialize controls.

5 OnLoad Set the basic layout of the web part like Title Chrometype Width/height These can also be found in the properties of the web part and be set individually after the web part has been deployed.

6 CreateChildControls Create child controls and layout here

7 OnPreRender Used for tasks that needs to be executed before the web part is rendered. Load data

8 Render Renders the whole web part Only overwritten i rare situations i case of special rendering requirements

9 .webpart Description for the web part shown in the Web part Gallery

10 .xml Adds the web part to a group in the Web part Gallery If a group is not specified, the web part is placed in the group Miscelleaneous

11 Feature.xml Location of the.xml Location of the.webpart

12 Manifest.xml Tells where the feature.xml file is located Location of the assembly

13 Create your own properties Enables you to add string/integer (textboxes), bool (checkboxes), collection (dropdownlists) to your properties. The web part already contains properties, so all you have to do is add your own.

14 Extend your properties Toolparts Enables you to add listboxes, peoplepicker, buttons etc. to the properties. Has it’s own lifecycle similar to a web part.

15 Time to deploy Two ways to deploy your wsp file: 1. Using install.bat (created by VS for you to use) REMEMBER to change the URL in the install.bat if you want to install it on a server with a different name. 2. Using stsadm stsadm -o addsolution -filename stsadm -o activatefeature {-filename | -name | -id } [-url ] [-force] A complete list of stsadm operations can be found here: http://blogs.technet.com/josebda/archive/2008/03/15/complete-reference-of-all-stsadm- operations-with-parameters-in-moss-2007-sp1.aspx

16 My favorite sites for SharePoint: http://www.codeproject.com http://tonybierman.blogspot.com/ http://www.sharepoint-tips.com/ http://stsadm.blogspot.com/ Google Groups

17 Debate - Why use web parts? ProsCons Integated part of SharePoint The developer is provided with libraries to make the development of web parts easier Consistens in design throughtout the web parts Might work in test environment but not in production Requires custom development Requires knowledge of the internal structure in SharePoint


Download ppt "Web parts for SharePoint. What’s a web part? Application that can be added to a page with a web part zone. Inhierits from web controls Can be developed."

Similar presentations


Ads by Google