Friday, November 13, 2009

Finding Edit mode in Sharepoint page

URL:

http://www.codeproject.com/KB/sharepoint/SwitchWPMode.aspx

BrowseDisplayMode : Represents the default display mode.

CatalogDisplayMode : Used for adding controls from a catalog of controls to a Web page

ConnectDisplayMode : Displays a special UI for users to manage connections between Web Part controls.

DesignDisplayMode : Used for changing the layout of Web pages containing Web Part controls.

EditDisplayMode : Displays a UI from which end users can edit and modify server controls

Ex:

WebPartManager wp = WebPartManager.GetCurrentWebPartManager(Page);

if (wp.DisplayMode == WebPartManager.BrowseDisplayMode)

      Do action here

else if (wp.DisplayMode == WebPartManager.DesignDisplayMode)

     Do action here

else

     Do action here

No comments: