MOSS 2007 – WCM Blank WebPart Page Zone ID’s

Posted by Jeff Julian on Geeks with Blogs See other posts from Geeks with Blogs or by Jeff Julian
Published on Wed, 09 Jun 2010 17:54:53 GMT Indexed on 2010/06/09 19:02 UTC
Read the original article Hit count: 372

Filed under:

SharePoint-Logo Here is the list of Zone ID’s for the Blank WebPart Page (BlankWebPartPage.aspx") that is part of the Publishing Portal with MOSS 2007:

  • TitleBar
  • Header
  • TopLeftRow
  • TopRightRow
  • CenterLeftColumn
  • CenterColumn
  • CenterRightColumn
  • Footer
  • RightColumn

I was in need of these and wasn’t able to find them with a simple search on Google so I wanted to share them with you.

To get a list of WebPartZone objects for a page that a webpart lives on can be done with the following code: 

foreach (WebPartZone zone in this.WebPartManager.Zones)

        this.Controls.Add(new LiteralControl(zone.ID + "<br />"));
}

Use this code in a webpart that inherits from Microsoft.SharePoint.WebPartPages.WebPart. This is a simple way to do the equivalent of a Response.Write while having the output in the webpart zone your part resides in.  It also saves you from attaching to the process and debugging with the watch or quick watch.

© Geeks with Blogs or respective owner