1 / 17

Web parts for SharePoint

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 using C# or VB The concept of web parts are not just for SharePoint. Web part lifecycle. Without postback. With postback. OnInit OnLoad

adonica
Download Presentation

Web parts for SharePoint

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 postback With 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. <name>.webpart • Description for the web part shown in the Web part Gallery

  10. <name>.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 <name>.xml • Location of the <name>.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: • 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. • Using stsadm • stsadm -o addsolution -filename <Solution filename> • stsadm -o activatefeature {-filename <relative path to Feature.xml> | -name <feature folder> | -id <feature Id>} [-url <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? Pros Cons 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

More Related