SharePoint 2003 Web Parts By Sam Nasr June 27,
Agenda Introduction Introduction Web Parts Presentation Web Parts Presentation Q&A (Open) Q&A (Open) Feedback & raffle Feedback & raffle
What is a Web Part? A modular portion of an ASP.Net web page. A modular portion of an ASP.Net web page. Visual content consists of: Visual content consists of: –Title bar –Frame –Content Provides custom functionality to SharePoint sites and portals. Provides custom functionality to SharePoint sites and portals. –Display Outlook contacts within a frame. –Display graphical data within a portion of a page. Based on.Net framework and ASP.NET. Based on.Net framework and ASP.NET. Integrate with Web Services, Office, and BizTalk Server. Integrate with Web Services, Office, and BizTalk Server. Web Parts are composed of: Web Parts are composed of: –Description file (.DWP - XML based) –Assembly (.DLL)
Web Parts Static or Dynamic Web Parts Static or Dynamic Web Parts Connectable Web Parts (i.e. Customer to Orders) Connectable Web Parts (i.e. Customer to Orders) Personal or Shared Views Personal or Shared Views Developed using FrontPage or Visual Studio Developed using FrontPage or Visual Studio
Web Part Evolution v1.0: VBScript or JavaScript for SharePoint v1.0: VBScript or JavaScript for SharePoint v2.0: Integrated.Net 1.1 functionality for SharePoint v2.0: Integrated.Net 1.1 functionality for SharePoint v3.0: Built on ASP.Net 2.0 for SharePoint 2007 and ASP.Net 2.0. v3.0: Built on ASP.Net 2.0 for SharePoint 2007 and ASP.Net 2.0.
Creating a Web Part 1. Download Web Part Template B88E3B5&displaylang=en B88E3B5&displaylang=en 2. Create a Web Part Project in VS 3. RenderWebPart() is the entry point of the code.
Adding a Web Part 1. Add a element to the c:\Inetpub\wwwroot\web.config 2. Import the.DWP file 3. Move the web part to a web part zone (or using Add button).
Web Part Gallery Web Part Page: web parts already added to the page (open & closed) Web Part Page: web parts already added to the page (open & closed) : gallery of web parts maintained by site Admin. : gallery of web parts maintained by site Admin. Virtual Server: web parts added to the root directory of the virtual server (i.e. \inetpub\wwwroot\wpcatalog) Virtual Server: web parts added to the root directory of the virtual server (i.e. \inetpub\wwwroot\wpcatalog) Online: web parts available from Microsoft.com Online: web parts available from Microsoft.com
Security Role Based: Role Based: –Readers: No WP modification rights –Contributors: can modify in Personal View only. –Administrators: Full rights Server Based: in web.config Server Based: in web.config Web Part Based: Code Access Security (CAS) Web Part Based: Code Access Security (CAS) –Increasing the Virtual Servers trust level –Installing the Web Part in the GAC –Creating a custom policy file for the Web Part Assembly
Debugging Web Parts Enable Tracing Enable Tracing Display messages to UI Display messages to UI Manually attach debugger to w3wp.exe Manually attach debugger to w3wp.exe
Debugging Tips Re-opening a closed web Part Re-opening a closed web Part –Re-insert from Web Gallery –FrontPage Append ?Contents=1 to URL to view contents Append ?Contents=1 to URL to view contents Append PageView=Shared or PageView=Personal Append PageView=Shared or PageView=Personal
Resources Web Part Template for Visual Studio Web Part Template for Visual Studio A74E-75936B88E3B5&displaylang=en A74E-75936B88E3B5&displaylang=en Son of Smart Part Son of Smart Part 3f974a7d0abe 3f974a7d0abe The Rational Guide to Building SharePoint Web Parts The Rational Guide to Building SharePoint Web Parts 1/ref=sr_1_1/ ?s=books&v=glance&n= /ref=sr_1_1/ ?s=books&v=glance&n= Microsoft SharePoint Products and Technologies Resource Kit Microsoft SharePoint Products and Technologies Resource Kit