Code missing

Sep 18, 2009 at 12:01 AM

Hi, I successfully connected to a SharePoint site using SharePoint Developer Explorer and everything seems to be good.  However, when I open an aspx page within the lists, part of the code was missing.  You can see the code in SharePoint Designer 2007, but not in Visual Studio.  Here's an example:

in Visual Studio 2008:  
<webpartpages:webpartzone runat="server" frametype="None" id="Main" title="loc:Main"><ZoneTemplate></ZoneTemplate></webpartpages:webpartzone> 

In SharePoint Designer 2007:
<webpartpages:webpartzone runat="server" frametype="None" id="Main" title="loc:Main"><ZoneTemplate>WebPartPages:DataFormWebPart runat="server" SuppressWebPartChrome="False" Description="" PartImageSmall="" DataSourceID="" MissingAssembly="Cannot import this Web Part." FrameType="Default" ConnectionID="00000000-0000-0000-0000-000000000000" DetailLink="" ExportControlledProperties="True" .... (ver long)</ZoneTemplate></webpartpages>

The wired thing is that when I save within VS 2008, the code will show up in Designer 2007, and all the function seems to work.  Can any one of you tell me why some code block is missing?



Sep 18, 2009 at 12:15 AM

Welcome to the wonderful world of SharePoint.

Within SharePoint you can have a web part page with web part zones in it. Through the UI you can dynamically add, remove, configure and move web parts. This does not change the contents of the page, because this would unghost (customize) the page. The trick is that SharePoint connects web parts to a web part zone in a page, including the order and its configuration. SharePoint Designer inserts those web parts (their XML configuration) into the source code of the page in the webpartzone, and extracts the modified web part configuration on save. Note however that on saving a page through SharePoint Designer you customize the page.

In your pasted example above there seems to be a bracket missing, it should read <ZoneTemplate><WebPartPages:...

SPDevExplorer only retrieves the contents of the page, it does not look at the web parts. Would be a nice feature for the future...