Customizing Web part shortcut menu (chrome)

Web part shortcut menu allows you to minimize, Close, Modify web part and export. To add new item, edit or modify existing item in menu you need to override CreateWebpartmenu method of WebPart base class and access the MenuItems collection of the Web Part’s WebPartMenu property.
List of Item IDs
• MSOMenu_Minimize
• MSOMenu_Restore
• MSOMenu_Close
• MSOMenu_Delete
• MSOMenu_Edit
• MSOMenu_Connections
• MSOMenu_Export
• MSOMenu_Help

Sample example

public override void CreateWebPartMenu()
MenuItem ParentItem, Item1, Item2;

//first we create three menu items 
//one as a parent item, and two submenu items 
//create the parent item 

ParentItem = new MenuItem("ParentItem", "", "ParentItemID");

//create a submenu item with a server event on click 
Item1 = new MenuItem("Item1", "Item1ID", new EventHandler(EventHandlerForItem1));

//create a submenu item with a client event on click 
Item2 = new MenuItem("Item2", "javascript:alert('Item2 was clicked');", "Item2ID");
// We then add the submenu items to the parent item. 


// We then decide that we'd like to add the parent item after the 
// "Edit Web Part Properties" item in the menu. 
// First we find the index of the "Edit" item 
int EditIndex =

// Then we insert the parent item after the "Edit" item 
this.WebPartMenu.MenuItems.Insert(EditIndex + 1, ParentItem);

// Make sure the parent item has a separator above it 
ParentItem.BeginSection = true;

// Check a custom property to decide whether to display the parent menu 
if (this.CustomProperty1 == true)
ParentItem.Visible = true;
ParentItem.Visible = false;
// Check another custom property to decide which menu item to enable 
// within the parent item 
if (this.CustomProperty2 == true)
Item1.Enabled = true;
Item2.Enabled = false;
Item1.Enabled = false;
Item2.Enabled = true;

MOSS 2007 Limits

Microsoft Office SharePoint Server (MOSS) 2007 Limits

Site Collections in a Web Application


Sites in a Site Collection


Sub-sites nested under a Site


Lists on a Site


Items in a List


Documents in a Library


Documents in a Folder


Maximum document file size


Documents in an Index


Search Scopes


User Profiles


Get to the WebPart Maintenance Page

For quick and easy access to the WebPart Maintenance Page simply append the following to the URL of any page with webparts: “?contents=1”.
So for example if your default page URL will look like this:
If you need to go to the WebPart Maintenance page for this page you would add the above to the end of the URL as follows:
This will open the WebPart Maintenance page for this page.You can delete, close, remove the webparts from the page easily.
Note: The changes made on this page are applicable for all the users.