Partilhar via


Setting Left/Right Zone size on a Enterprise Portal page

Enterprise Portal supports 8 different page templates. Each of these come with different SharePoint Zones and each has a predefined width assigned to each of the zones. Further SharePoint Zones by nature tend to expand to fit the contents (i.e. Webparts).

Suppose you are using the page template with 2 zones (Left & Right) and you want to set the right zone to be with 20%, EP provides a API that you can use to set the width of the WebPart zone in terms of Percentages.

Just add the following code to your user control –

protected override void OnPreRender(EventArgs e)

    {

        base.OnPreRender(e);

        //Add style to get 80/20 column widths for the left/right web part zones

        Microsoft.Dynamics.Framework.Portal.UI.StyleRegisterHelper.SetWebPartZoneWidths(this.Page, Unit.Percentage(80), Unit.Percentage(20));

    }