This documentation is archived and is not being maintained.

WebPart.ContainerWidth Property

Windows SharePoint Services 3

NOTE: This API is now obsolete.

Gets the value set by the page author as a hint to the Web Part of how wide to expect the containing Web Part zone to be.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

[ObsoleteAttribute("Use WebPartZone.ContainerWidth instead.")]
protected string ContainerWidth { get; }

Property Value

Type: System.String
A string that specifies a CSS width as a percentage (%) or pixels (PX).

The value of the ContainerWidth property is available only at run time. The values of the EffectiveFrameType, ContainerWidth, and Permissions properties can change just before the Web Part is rendered. This is because the ZoneID property might have changed, which affects the values of these properties. These properties are guaranteed to have their final values, taking into account any needed zone changes, when the Web Part's RenderWebPart method is called.