SlideShare a Scribd company logo
1 of 21
SharePoint Web Parts 101Silicon Valley Code Camp 2009October 3, 2009 Joseph Ackerman, Senior ConsultantMicrosoft Consulting Services, GICS, Dell Inc.joseph_ackerman@dell.comSpecial thanks to Shawn Parker for his assistance with this presentation
The Ever-Popular Intro Slide Joseph Ackerman (joseph_ackerman@dell.com) 20 + years of software development for clients of all sizes and shapes Wells Fargo Hewlett-Packard Aetna Visa Stanford University Currently consulting as part of Dell’s Microsoft Consulting Services Formerly Allin, Microsoft’s Northwest Region Partner of the Year 2008 Most recent project: internal systems for eBay
Agenda Why are we talking about this? User Controls, Server Controls and Web Parts The Steps Deployment Choices The Future Resources DELL CONFIDENTIAL 3
Why are we talking about this? SharePoint adoption has exploded over the last couple of years Programmers and Software developers are often presented with the “opportunity” to work with SharePoint because someone in the business (frequently a non-technical person) has made that decision for them  If you work in an IT environment that runs on Windows Servers, the chances are pretty good that someone in your organization is already running SharePoint Bottom Line: it’s probably out there already whether you like it or not – but we all like to work, especially in today’s economic climate, right? DELL CONFIDENTIAL 4
User Controls Made up of HTML/ASP page fragments Maybe some code behind Great for breaking up functionality within an application Not very portable, hard to re-use DELL CONFIDENTIAL 5
Server Controls Harder to write UI elements must be built in code Easier to use across multiple applications DELL CONFIDENTIAL 6
Web Parts Similar to Server Controls Different inheritance tree Some additional requirements for development, deployment and use DELL CONFIDENTIAL 7
Types of Web Parts ASP.Net  Web Parts This is what we will build in our demo today Can be used on ASP.Net and SharePoint pages We’re going to do it from scratch, even though there are some helpful add-on tools SharePoint Web Parts Used in SP 2003; for 2007, DON’T. Data Web Parts Built in; use XSLT to display a data source User Controls wrapped in SmartPart (see CodePlex) Just a wrapper that allows UserControls to behave like web parts Not very secure, Poor performance DELL CONFIDENTIAL 8
The Steps Create a new project (C# windows class library) Sign the assembly References (System.web and Microsoft.SharePoint) Update assemblyinfo.cs (for anonymous users) Update web.config with Safecontrol Update/Create the web part classes Update/Create “.webpart” files Build and Deploy DELL CONFIDENTIAL 9
1. Create a new project C# Class Library project I love VB too, but do yourself a favor and use C# instead – SharePoint is not CLS compliant DELL CONFIDENTIAL 10
2. Sign the Assembly It’s all about trust Allows you to create a strong name for your assembly DELL CONFIDENTIAL 11
3. Set Your References System.Web Microsoft.SharePoint DELL CONFIDENTIAL 12
4. Update assemblyinfo.cs Add a reference to System.Security Allow anonymous users by adding an attribute containing AllowPartiallyTrustedCallers() It’s good practice to put your Public Key Token in here as a comment DELL CONFIDENTIAL 13
5. Update web.config Add your assembly to the SafeControls list Use the full, four-part name DLL name (without extension) Version number Culture Namespace Add the TypeName  For only one class, use the name For all classes in the namespace, use * Safe should equal “true” DELL CONFIDENTIAL 14
6. Create your web part classes Your functionality goes here Pick your output method CreateChildControls() Add controls to the web part control collection Render() Add HTML to the HTMLTextWriter object parameter  DELL CONFIDENTIAL 15
7.  Create your .webpart (xml) file Only if you are deploying to the bin folder of your site If you are deploying to the GAC, this is not necessary Where can you find an example of the format? In the web part gallery DELL CONFIDENTIAL 16
8. Build and Deploy If you are copying your .dll to the GAC, don’t forget to run IISRESET /Restart on your web server If you are deploying directly to your web site, make sure that you DLL is in the /bin folder and the .webpart file is in the /wpcatalog folder  Both are just off the root of your web site DELL CONFIDENTIAL 17
Best Practices Runtime performance is more important than quick-n-easy development Learn to write real web parts, don’t depend on the SmartPart wrapper Common “Base” web part SharePoint object disposal Single-purpose parts and logic Consistent deployment model DELL CONFIDENTIAL 18
Resources Web Parts Resource Center http://msdn.microsoft.com/en-us/sharepoint/bb851483.aspx Instructional Video, Module 2: web parts http://www.microsoft.com/winme/0901/34867/mod2/index.html DELL CONFIDENTIAL 19
Questions? DELL CONFIDENTIAL 20
www.dell.com

More Related Content

What's hot

Developing Office Add-Ins
Developing Office Add-InsDeveloping Office Add-Ins
Developing Office Add-InsPeter Plessers
 
Apache Flex: Overview
Apache Flex: OverviewApache Flex: Overview
Apache Flex: OverviewTarun Telang
 
Building Composite Application for Lotus Notes 8
Building Composite Application for Lotus Notes 8Building Composite Application for Lotus Notes 8
Building Composite Application for Lotus Notes 8dominion
 
Oracle APEX plugins - AUSOUG Connect 2016
Oracle APEX plugins - AUSOUG Connect 2016Oracle APEX plugins - AUSOUG Connect 2016
Oracle APEX plugins - AUSOUG Connect 2016Lino Schildenfeld
 
All about apple mail to outlook 2011 migration
All about apple mail to outlook 2011 migrationAll about apple mail to outlook 2011 migration
All about apple mail to outlook 2011 migrationCauvery Varma
 
Do's and don'ts for Office 365 development
Do's and don'ts for Office 365 developmentDo's and don'ts for Office 365 development
Do's and don'ts for Office 365 developmentChris O'Brien
 
Flex vs. HTML5 for RIAS
Flex vs. HTML5 for RIASFlex vs. HTML5 for RIAS
Flex vs. HTML5 for RIASPamela Fox
 
SharePoint 2010 - InfoPath, Workflow
SharePoint 2010 - InfoPath, WorkflowSharePoint 2010 - InfoPath, Workflow
SharePoint 2010 - InfoPath, WorkflowJonathon Schultz
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsBest Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsAlexander Meijers
 
SharePoint Framework -The future of SharePoint/ Office 365 developer ecosystem.
SharePoint Framework -The future of SharePoint/ Office 365 developer ecosystem. SharePoint Framework -The future of SharePoint/ Office 365 developer ecosystem.
SharePoint Framework -The future of SharePoint/ Office 365 developer ecosystem. Kushan Lahiru Perera
 
APEX 5.1 features - AUSOUG Connect 2016
APEX 5.1 features - AUSOUG Connect 2016APEX 5.1 features - AUSOUG Connect 2016
APEX 5.1 features - AUSOUG Connect 2016Lino Schildenfeld
 
Building configurable applications for the web
Building configurable applications for the webBuilding configurable applications for the web
Building configurable applications for the websupertom
 
Upcoming new features of selenium in automation testing
Upcoming new features of selenium in automation testingUpcoming new features of selenium in automation testing
Upcoming new features of selenium in automation testingsoftware testingchennai
 
Open Source examples from Adobe : Oscon kiosk
Open Source examples from Adobe : Oscon kioskOpen Source examples from Adobe : Oscon kiosk
Open Source examples from Adobe : Oscon kioskDave McAllister
 
Creating a Data Driven UI Framework
Creating a Data Driven UI FrameworkCreating a Data Driven UI Framework
Creating a Data Driven UI FrameworkAnkur Bansal
 
Team Foundation Server - Source Control
Team Foundation Server - Source ControlTeam Foundation Server - Source Control
Team Foundation Server - Source ControlDhirendra Singh
 
Office Add-ins developer community call-January 2020
Office Add-ins developer community call-January 2020Office Add-ins developer community call-January 2020
Office Add-ins developer community call-January 2020Microsoft 365 Developer
 

What's hot (20)

Developing Office Add-Ins
Developing Office Add-InsDeveloping Office Add-Ins
Developing Office Add-Ins
 
Office Add-in development
Office Add-in developmentOffice Add-in development
Office Add-in development
 
Apache Flex: Overview
Apache Flex: OverviewApache Flex: Overview
Apache Flex: Overview
 
Building Composite Application for Lotus Notes 8
Building Composite Application for Lotus Notes 8Building Composite Application for Lotus Notes 8
Building Composite Application for Lotus Notes 8
 
Oracle APEX plugins - AUSOUG Connect 2016
Oracle APEX plugins - AUSOUG Connect 2016Oracle APEX plugins - AUSOUG Connect 2016
Oracle APEX plugins - AUSOUG Connect 2016
 
All about apple mail to outlook 2011 migration
All about apple mail to outlook 2011 migrationAll about apple mail to outlook 2011 migration
All about apple mail to outlook 2011 migration
 
Integrating Office Web Apps with SharePoint 2013
Integrating Office Web Apps with SharePoint 2013Integrating Office Web Apps with SharePoint 2013
Integrating Office Web Apps with SharePoint 2013
 
Do's and don'ts for Office 365 development
Do's and don'ts for Office 365 developmentDo's and don'ts for Office 365 development
Do's and don'ts for Office 365 development
 
Flex vs. HTML5 for RIAS
Flex vs. HTML5 for RIASFlex vs. HTML5 for RIAS
Flex vs. HTML5 for RIAS
 
SharePoint 2010 - InfoPath, Workflow
SharePoint 2010 - InfoPath, WorkflowSharePoint 2010 - InfoPath, Workflow
SharePoint 2010 - InfoPath, Workflow
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsBest Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point Solutions
 
SharePoint Framework -The future of SharePoint/ Office 365 developer ecosystem.
SharePoint Framework -The future of SharePoint/ Office 365 developer ecosystem. SharePoint Framework -The future of SharePoint/ Office 365 developer ecosystem.
SharePoint Framework -The future of SharePoint/ Office 365 developer ecosystem.
 
OnTime Partner Webinar September 2011
OnTime Partner Webinar September 2011OnTime Partner Webinar September 2011
OnTime Partner Webinar September 2011
 
APEX 5.1 features - AUSOUG Connect 2016
APEX 5.1 features - AUSOUG Connect 2016APEX 5.1 features - AUSOUG Connect 2016
APEX 5.1 features - AUSOUG Connect 2016
 
Building configurable applications for the web
Building configurable applications for the webBuilding configurable applications for the web
Building configurable applications for the web
 
Upcoming new features of selenium in automation testing
Upcoming new features of selenium in automation testingUpcoming new features of selenium in automation testing
Upcoming new features of selenium in automation testing
 
Open Source examples from Adobe : Oscon kiosk
Open Source examples from Adobe : Oscon kioskOpen Source examples from Adobe : Oscon kiosk
Open Source examples from Adobe : Oscon kiosk
 
Creating a Data Driven UI Framework
Creating a Data Driven UI FrameworkCreating a Data Driven UI Framework
Creating a Data Driven UI Framework
 
Team Foundation Server - Source Control
Team Foundation Server - Source ControlTeam Foundation Server - Source Control
Team Foundation Server - Source Control
 
Office Add-ins developer community call-January 2020
Office Add-ins developer community call-January 2020Office Add-ins developer community call-January 2020
Office Add-ins developer community call-January 2020
 

Similar to Share Point Web Parts 101

Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Jeff Blankenburg
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Clint Edmonson
 
San Diego ASP.NET Meeting Oct 21st
San  Diego  ASP.NET Meeting Oct 21stSan  Diego  ASP.NET Meeting Oct 21st
San Diego ASP.NET Meeting Oct 21stWoody Pewitt
 
Oracle Web ADI Implementation Steps
Oracle Web ADI Implementation StepsOracle Web ADI Implementation Steps
Oracle Web ADI Implementation Stepsstandale
 
visual basic 2005 programmer certification
visual basic 2005 programmer certificationvisual basic 2005 programmer certification
visual basic 2005 programmer certificationVskills
 
2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices
2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices
2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservicesDaniel Fisher
 
MSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF DemystifiedMSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF DemystifiedDave Bost
 
Microsoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateMicrosoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateAdam John
 
Deploying Code In SharePoint
Deploying Code In SharePointDeploying Code In SharePoint
Deploying Code In SharePointCorey Roth
 
Mix Tech Ed Update No Video
Mix Tech Ed Update No VideoMix Tech Ed Update No Video
Mix Tech Ed Update No VideoAllyWick
 
Idol server 11.0.0_release_notes_en
Idol server 11.0.0_release_notes_enIdol server 11.0.0_release_notes_en
Idol server 11.0.0_release_notes_enAndrey Karpov
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan
 
Silverlight Chapter 01 - Introduction
Silverlight Chapter 01 - IntroductionSilverlight Chapter 01 - Introduction
Silverlight Chapter 01 - IntroductionBill Hatfield
 
Keeping Current with ColdFusion - Adobe Max 2011
Keeping Current with ColdFusion - Adobe Max 2011Keeping Current with ColdFusion - Adobe Max 2011
Keeping Current with ColdFusion - Adobe Max 2011Rupesh Kumar
 
AIR - Framework ( Cairngorm and Parsley )
AIR - Framework ( Cairngorm and Parsley )AIR - Framework ( Cairngorm and Parsley )
AIR - Framework ( Cairngorm and Parsley )senthil0809
 
ILUG 2007 - Notes and Office Integration
ILUG 2007 - Notes and Office IntegrationILUG 2007 - Notes and Office Integration
ILUG 2007 - Notes and Office IntegrationJohn Head
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Ido Flatow
 

Similar to Share Point Web Parts 101 (20)

Visual Studio 2012 introduction
Visual Studio  2012 introductionVisual Studio  2012 introduction
Visual Studio 2012 introduction
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
 
Asp.net Web Development.pdf
Asp.net Web Development.pdfAsp.net Web Development.pdf
Asp.net Web Development.pdf
 
San Diego ASP.NET Meeting Oct 21st
San  Diego  ASP.NET Meeting Oct 21stSan  Diego  ASP.NET Meeting Oct 21st
San Diego ASP.NET Meeting Oct 21st
 
Oracle Web ADI Implementation Steps
Oracle Web ADI Implementation StepsOracle Web ADI Implementation Steps
Oracle Web ADI Implementation Steps
 
visual basic 2005 programmer certification
visual basic 2005 programmer certificationvisual basic 2005 programmer certification
visual basic 2005 programmer certification
 
2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices
2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices
2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices
 
MSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF DemystifiedMSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF Demystified
 
Microsoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateMicrosoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New Update
 
Deploying Code In SharePoint
Deploying Code In SharePointDeploying Code In SharePoint
Deploying Code In SharePoint
 
Mix Tech Ed Update No Video
Mix Tech Ed Update No VideoMix Tech Ed Update No Video
Mix Tech Ed Update No Video
 
Idol server 11.0.0_release_notes_en
Idol server 11.0.0_release_notes_enIdol server 11.0.0_release_notes_en
Idol server 11.0.0_release_notes_en
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
 
SilverlightCh01
SilverlightCh01SilverlightCh01
SilverlightCh01
 
Silverlight Chapter 01 - Introduction
Silverlight Chapter 01 - IntroductionSilverlight Chapter 01 - Introduction
Silverlight Chapter 01 - Introduction
 
Keeping Current with ColdFusion - Adobe Max 2011
Keeping Current with ColdFusion - Adobe Max 2011Keeping Current with ColdFusion - Adobe Max 2011
Keeping Current with ColdFusion - Adobe Max 2011
 
AIR - Framework ( Cairngorm and Parsley )
AIR - Framework ( Cairngorm and Parsley )AIR - Framework ( Cairngorm and Parsley )
AIR - Framework ( Cairngorm and Parsley )
 
ILUG 2007 - Notes and Office Integration
ILUG 2007 - Notes and Office IntegrationILUG 2007 - Notes and Office Integration
ILUG 2007 - Notes and Office Integration
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
 

Recently uploaded

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Recently uploaded (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

Share Point Web Parts 101

  • 1. SharePoint Web Parts 101Silicon Valley Code Camp 2009October 3, 2009 Joseph Ackerman, Senior ConsultantMicrosoft Consulting Services, GICS, Dell Inc.joseph_ackerman@dell.comSpecial thanks to Shawn Parker for his assistance with this presentation
  • 2. The Ever-Popular Intro Slide Joseph Ackerman (joseph_ackerman@dell.com) 20 + years of software development for clients of all sizes and shapes Wells Fargo Hewlett-Packard Aetna Visa Stanford University Currently consulting as part of Dell’s Microsoft Consulting Services Formerly Allin, Microsoft’s Northwest Region Partner of the Year 2008 Most recent project: internal systems for eBay
  • 3. Agenda Why are we talking about this? User Controls, Server Controls and Web Parts The Steps Deployment Choices The Future Resources DELL CONFIDENTIAL 3
  • 4. Why are we talking about this? SharePoint adoption has exploded over the last couple of years Programmers and Software developers are often presented with the “opportunity” to work with SharePoint because someone in the business (frequently a non-technical person) has made that decision for them If you work in an IT environment that runs on Windows Servers, the chances are pretty good that someone in your organization is already running SharePoint Bottom Line: it’s probably out there already whether you like it or not – but we all like to work, especially in today’s economic climate, right? DELL CONFIDENTIAL 4
  • 5. User Controls Made up of HTML/ASP page fragments Maybe some code behind Great for breaking up functionality within an application Not very portable, hard to re-use DELL CONFIDENTIAL 5
  • 6. Server Controls Harder to write UI elements must be built in code Easier to use across multiple applications DELL CONFIDENTIAL 6
  • 7. Web Parts Similar to Server Controls Different inheritance tree Some additional requirements for development, deployment and use DELL CONFIDENTIAL 7
  • 8. Types of Web Parts ASP.Net Web Parts This is what we will build in our demo today Can be used on ASP.Net and SharePoint pages We’re going to do it from scratch, even though there are some helpful add-on tools SharePoint Web Parts Used in SP 2003; for 2007, DON’T. Data Web Parts Built in; use XSLT to display a data source User Controls wrapped in SmartPart (see CodePlex) Just a wrapper that allows UserControls to behave like web parts Not very secure, Poor performance DELL CONFIDENTIAL 8
  • 9. The Steps Create a new project (C# windows class library) Sign the assembly References (System.web and Microsoft.SharePoint) Update assemblyinfo.cs (for anonymous users) Update web.config with Safecontrol Update/Create the web part classes Update/Create “.webpart” files Build and Deploy DELL CONFIDENTIAL 9
  • 10. 1. Create a new project C# Class Library project I love VB too, but do yourself a favor and use C# instead – SharePoint is not CLS compliant DELL CONFIDENTIAL 10
  • 11. 2. Sign the Assembly It’s all about trust Allows you to create a strong name for your assembly DELL CONFIDENTIAL 11
  • 12. 3. Set Your References System.Web Microsoft.SharePoint DELL CONFIDENTIAL 12
  • 13. 4. Update assemblyinfo.cs Add a reference to System.Security Allow anonymous users by adding an attribute containing AllowPartiallyTrustedCallers() It’s good practice to put your Public Key Token in here as a comment DELL CONFIDENTIAL 13
  • 14. 5. Update web.config Add your assembly to the SafeControls list Use the full, four-part name DLL name (without extension) Version number Culture Namespace Add the TypeName For only one class, use the name For all classes in the namespace, use * Safe should equal “true” DELL CONFIDENTIAL 14
  • 15. 6. Create your web part classes Your functionality goes here Pick your output method CreateChildControls() Add controls to the web part control collection Render() Add HTML to the HTMLTextWriter object parameter DELL CONFIDENTIAL 15
  • 16. 7. Create your .webpart (xml) file Only if you are deploying to the bin folder of your site If you are deploying to the GAC, this is not necessary Where can you find an example of the format? In the web part gallery DELL CONFIDENTIAL 16
  • 17. 8. Build and Deploy If you are copying your .dll to the GAC, don’t forget to run IISRESET /Restart on your web server If you are deploying directly to your web site, make sure that you DLL is in the /bin folder and the .webpart file is in the /wpcatalog folder Both are just off the root of your web site DELL CONFIDENTIAL 17
  • 18. Best Practices Runtime performance is more important than quick-n-easy development Learn to write real web parts, don’t depend on the SmartPart wrapper Common “Base” web part SharePoint object disposal Single-purpose parts and logic Consistent deployment model DELL CONFIDENTIAL 18
  • 19. Resources Web Parts Resource Center http://msdn.microsoft.com/en-us/sharepoint/bb851483.aspx Instructional Video, Module 2: web parts http://www.microsoft.com/winme/0901/34867/mod2/index.html DELL CONFIDENTIAL 19