Jeff Julian's Blog

Founder of Geekswithblogs.net


News

GWB Tag







SharePoint Consulting (Kansas City Metro)

AJI Software - Careers





My Stats

  • Posts - 678
  • Comments - 611
  • Trackbacks - 925

Twitter












Tag Cloud


Recent Comments


Recent Posts


Archives


Post Categories


Image Galleries


My Company


My Fav. Sites



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.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Comments

Gravatar # re: MOSS 2007 – WCM Blank WebPart Page Zone ID’s
Posted by Jim Bennett on 11/22/2010 6:46 AM
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?
Gravatar # re: MOSS 2007 – WCM Blank WebPart Page Zone ID’s
Posted by Tony on 3/30/2011 3:22 AM
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.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: