SharePoint Development For Asp Net Developers


Published on

Slides given for my talk about an introduction to SharePoint development at Oklahoma City Developer Group - December 2008.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Demo building a user control, deployment, and a web part to load that control.Explain Safe Controls_ControlTemplates folder
  • Explain the manifest.xml and cab.ddf
  • Demo building a web part. TestWebPart (System.Web.UI.WebControls.WebParts.WebPart)Feature.xmlElements.xmlMyWebPart.webpart
  • Demo building a feature receiver.TestFeatureReceiver.cs
  • Demo the use of BDC Tools, the MetaData Model and the Import Process
  • SharePoint Development For Asp Net Developers

    1. 1. SharePoint Development for ASP.NET Developers<br />Presenter: Corey Roth<br />Enterprise Consultant<br />Stonebridge<br />Blog:<br />
    2. 2. Corey Roth<br />Consultant for Stonebridge<br />Worked in Consumer Electronics, Travel, Advertising, and Energy industries<br />Currently doing MOSS development specializing in Enterprise Search and ECM<br />OSU Graduate<br />Microsoft Award for Customer Excellence (ACE) Winner<br />E-mail:<br />Blog: (mirrored on<br />
    3. 3. SharePoint 3.0 or MOSS 2007?<br />SharePoint 3.0 (WSS) is included with Windows Server<br />MOSS extends the features of WSS<br />MOSS requires a separate license<br />MOSS includes Business Data Catalog (BDC), Enterprise Seach, Excel Services, My Sites, KPI dashboards, People Search, Forms Services, etc.<br />
    4. 4. Environment<br />Virtualization – Windows Server, WSS or MOSS, and Visual Studio installed<br />SharePoint on Remote Server – Requires remote debugging<br />SharePoint on Vista – Works but not supported<br />
    5. 5. SharePoint Basics<br />Farm – Represents the collection of servers of the SharePoint deployment<br />Web Applications – Typically one or more of these maps to a web site in IIS (i.e.: Port 80)<br />Site Collection (SPSite) – Will have at least one. Groups sites together<br />Site (SPWeb) – Represents a site or subsite in a Site Collection. Contains pages, lists, etc.<br />Feature – Allows code and SharePoint changes to occur at the click of a button<br />
    6. 6. What’s different about SharePoint development?<br />Environment<br />Deployment<br />Pages and Sites<br />Must deploy DLLs to GAC or use Code Access Security if deploying to bin folder<br />User controls must be hosted by a web part<br />
    7. 7. 12 Hive<br />Location of most key SharePoint files: C:Program FilesCommon Filesmicrosoft sharedWeb Server Extensions12<br />
    8. 8. 12 Hive (Continued)<br />
    9. 9. Building a User Control with Visual Studio<br />Web Application Project<br />Reference Microsoft.SharePoint.dll<br />Must be registered as safe for SharePoint to execute<br />Typically deployed to bin folder using Code Access Security<br />Controls are typically deployed to the CONTROLTEMPLATES folder in the 12 hive.<br />_ControlTemplates Virtual Directory<br />Complete instructions are on my blog<br />
    10. 10. SafeControls<br />SharePoint won’t execute a web part or user control unless it knows it is safe<br />Declare an assembly and namespace safe in web.config<br />SafeControls element<br />Can be automated using a solution package (.wsp)<br />
    11. 11. SharePoint API<br />SPContext – Used to get reference to the current site or site collection<br />All uses of SPSite or SPWeb must be disposed (use a using statement)<br />Most collections do not have an “Exists” method<br />Most objects require a call to .Update to save any changes made<br />Some API calls require elevated security – Pass a delegate to RunWithElevatedPrivleges<br />
    12. 12. Demo<br />
    13. 13. Deployment Options<br />Manually copy binaries, feature files, pages, and controls to appropriate folders on SharePoint server<br />Create a Feature – Would still have to manually copy files<br />Create a Solution Package (.wsp) – A cab file that contains a manfiest telling SharePoint how to deploy<br />
    14. 14. What the Solution Package does…<br />Backs up your web.config<br />Changes the trust element to WSS_Custom in web.config<br />Backs up trust configuration file – wss_minimaltrust.config becomes wss_custom_wss_minimaltrust.config<br />Changes the path to the trust configuration file in the web.config <trustLevel> element<br />Adds code access security settings from manifest.xml<br />More information on my blog<br />
    15. 15. Demo<br />
    16. 16. Building and Deploying a Web Part<br />Deploys similarly to a user control<br />.webpart (or .dwp) file tells SharePoint where to find the web part’s code<br />Use a feature to add the web part to the gallery<br />Complete instructions can be found on my blog<br />
    17. 17. Demo<br />
    18. 18. Feature Receivers<br />Feature Receivers allow you to execute code when a feature is Installed, Uninstalled, Activated, or Deactivated<br />Create a class that inherits from SPFeatureReceiver<br />Configured in Feature.xml<br />SPFeatureProperties.Feature.Parent contains reference to SPWeb or SPSite object depending on scope of feature (must be cast)<br />
    19. 19. Demo<br />
    20. 20. References<br />Dot Net Mafia Blog<br /><br />Office SharePoint Server SDK<br /><br />STSDev<br /><br />SharePoint Blogs<br /><br />
    21. 21. Questions?<br />
    22. 22. Thanks<br />Corey Roth<br /><br /><br />