Disable “Add, Edit and Delete Web Parts” within a Web Part Zone

Recently, I have been working with page layouts and I wanted to ensure webparts are added to the web part zone only programmatically.  I wanted end users are not able to add, edit or remove webparts from  Web Part Zone.

I have find some web part zone properties like  “AllowLayoutChange” property which can be used to ensure “Add a Web Part”  is hidden while page is in edit mode.

<div>
                <WebPartPages:WebPartZone runat=”server” AllowLayoutChange=”false”AllowPersonalization=”false”
               FrameType=”TitleBarOnly” ID=”MainZone” Title=”Main Zone” Orientation=”Vertical”>
                <ZoneTemplate></ZoneTemplate>
                </WebPartPages:WebPartZone>
</div>



Enregistrer un commentaire