Geeks With Blogs

News
Archives
Jeff Julian's Blog CEO of Enterprise Marketer

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.

Posted on Wednesday, June 9, 2010 6:54 AM | Back to top


Comments on this post: MOSS 2007 – WCM Blank WebPart Page Zone ID’s

# re: MOSS 2007 – WCM Blank WebPart Page Zone ID’s
Requesting Gravatar...
Jeff,

I am building a webpart that needs to be able to enumerate webpart zones for a selected site as part of it's functionality. The webpart will not reside on the page it is enumerating. Do you know if there's a way to do this?
Left by Jim Bennett on Nov 22, 2010 6:46 AM

# re: MOSS 2007 – WCM Blank WebPart Page Zone ID’s
Requesting Gravatar...
This is great, sometimes it's impossible to find things on the internet which sounds strange, but very true. Sorry Jim, but I don't have that answer for you as I have no idea how that works. Things like that can be so frustrating and thanks to people like Jeff, we are able to figure them out and find things. Thanks for sharing and keep up the great work.
Left by Tony on Mar 30, 2011 3:22 AM

Your comment:
 (will show your gravatar)


Copyright © Jeff Julian | Powered by: GeeksWithBlogs.net