ENTERPRISE

Microsoft Content Management Server Development : Building SharePoint Web Parts - Configuring the Web Part, Debugging the Web Part

5/23/2013 7:55:32 PM

1. Configuring the Web Part

We have now added our Web Part to the Web Part Page and it is working with the default settings. In the next step, we will change these settings.

1.
On the top right corner of the Web Part, click the down arrow to bring up the Web Part menu and select Modify Shared Web Part

As we have set the WebPartStorage attribute on our properties to Storage.Shared we can only modify the shared view, which applies to this instance of the Web Part for all users. If we want users to store personalized Web Part custom property values, we must set the WebPartStorage attribute on our property to Storage.Personal.


2.
The Tool Pane will now appear on the right-hand side of your screen.

3.
Expand the MCMS Listing Presentation group.

4.
Copy the contents of DefaultXsl.xslt into the Presentation XSLT textbox (a larger textbox can be opened by clicking the ellipsis [...] to the right of the textbox).

5.
Copy the contents of TestXml.xml into the Test XML textbox.

6.
Click Apply to see the settings on-screen or OK to apply the settings and close the Tool Pane.

The page should refresh and the Web Part will render a list of items in the MCMS /Channels/ path.


2. Debugging the Web Part

As our Web Part is now running via WSS/SPS, we cannot debug the Web Part directly by using the Visual Studio .NET Start Debugging option.

By default WSS/SPS has debugging turned off. To turn on debugging, edit the Web.config for the IIS Virtual Server and set the debug attribute to true.


To debug our Web Part from the SPS/WSS server using Visual Studio .NET, we must add the Web Part to a Web Part Page and perform the following actions:

1.
Open the ExtensibleMCMSPageListingWebPart project in Visual Studio .NET.

2.
Set a breakpoint on the RenderWebPart() method in NavigationWebPart.cs.

3.
From the Tools menu, select Debug Processes (or hit Alt + Ctrl + P).

4.
Select the w3wp.exe process and click Attach.

5.
Verify that the Common Language Runtime is checked and click OK:

6.
Click Close on the Processes dialog and refresh the Web Part Page.

7.
Your breakpoint should now be selected and you should be able to step through the code.

Your Web Part must be compiled in Debug configuration to ensure that the debug symbols are deployed to the server.

Other  
 
Video
Video tutorials
- How To Install Windows 8

- How To Install Windows Server 2012

- How To Install Windows Server 2012 On VirtualBox

- How To Disable Windows 8 Metro UI

- How To Install Windows Store Apps From Windows 8 Classic Desktop

- How To Disable Windows Update in Windows 8

- How To Disable Windows 8 Metro UI

- How To Add Widgets To Windows 8 Lock Screen

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010
programming4us programming4us
Top 10
Free Mobile And Desktop Apps For Accessing Restricted Websites
MASERATI QUATTROPORTE; DIESEL : Lure of Italian limos
TOYOTA CAMRY 2; 2.5 : Camry now more comely
KIA SORENTO 2.2CRDi : Fuel-sipping slugger
How To Setup, Password Protect & Encrypt Wireless Internet Connection
Emulate And Run iPad Apps On Windows, Mac OS X & Linux With iPadian
Backup & Restore Game Progress From Any Game With SaveGameProgress
Generate A Facebook Timeline Cover Using A Free App
New App for Women ‘Remix’ Offers Fashion Advice & Style Tips
SG50 Ferrari F12berlinetta : Prancing Horse for Lion City's 50th
Popular Tags
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Exchange Server Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe Photoshop CorelDRAW X5 CorelDraw 10 windows Phone 7 windows Phone 8 Iphone