Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
AllowMinimize Property

WebPart.AllowMinimize Property

Gets or sets a value indicating whether end users can minimize a WebPart control.

Namespace: System.Web.UI.WebControls.WebParts
Assembly: System.Web (in system.web.dll)

[ThemeableAttribute(false)] 
public virtual bool AllowMinimize { get; set; }
/** @property */
public boolean get_AllowMinimize ()

/** @property */
public void set_AllowMinimize (boolean value)

public function get AllowMinimize () : boolean

public function set AllowMinimize (value : boolean)

Not applicable.

Property Value

true if the WebPart control can be minimized; otherwise, false. The default value is true.

The AllowMinimize property, if set to false, prevents an end user from being able to minimize the control, and the user interface (UI) for minimizing the control does not appear in the control's title bar. In Web Parts terminology, when the AllowMinimize property is set to false, the minimize verb does not appear on the control's verbs menu.

When a user minimizes a control, it reduces the control's size down to a minimal area that displays only part of the control's title bar and title.

This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and Introduction to ASP.NET Themes.

The personalization scope of this property is set to Shared and can be modified only by authorized users. For more information, see PersonalizableAttribute and Web Parts Personalization Overview.

The following code example demonstrates how to change the default setting of the AllowMinimize property for a custom Web Parts control, so that the control cannot be minimized by a user. This example assumes the use of a custom WebPart control, TextDisplayWebPart, which is found in the Example section of the WebPart class overview.

In the declarative markup for the Web page, on the <aspSample:TextDisplayWebPart> element that references the control, note the AllowMinimize="false" attribute, which hides the minimize verb in the WebPart control's verbs menu, and prevents a user from being able to minimize the control. Load the page in a browser, and click the verbs menu on the WebPart control. The minimize verb, which would normally be present on the verbs menu, is hidden because you disabled it in the declarative markup for the control.

<%@ page language="C#" %>
<%@ register tagprefix="aspSample" 
             Namespace="Samples.AspNet.CS.Controls" 
             Assembly="TextDisplayWebPartCS"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
  <form id="Form1" runat="server">
    <asp:webpartmanager id="WebPartManager1" runat="server" />
    <asp:webpartzone
      id="WebPartZone1"
      runat="server"
      title="Zone 1"
      PartChromeType="TitleAndBorder">
        <parttitlestyle font-bold="true" ForeColor="#3300cc" />
        <partstyle
          borderwidth="1px"   
          borderstyle="Solid"  
          bordercolor="#81AAF2" />
        <zonetemplate>
          <aspSample:TextDisplayWebPart 
            runat="server"   
            id="textwebpart" 
            title = "Text Content WebPart" 
            AllowMinimize="false" />
        </zonetemplate>
    </asp:webpartzone>
  </form>
</body>
</html>

<%@ page language="VJ#" %>
<%@ register tagprefix="aspSample" 
             Namespace="Samples.AspNet.JSL.Controls" 
             Assembly="TextDisplayWebPartJSL"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
  <form id="Form1" runat="server">
    <asp:webpartmanager id="WebPartManager1" runat="server" />
    <asp:webpartzone
      id="WebPartZone1"
      runat="server"
      title="Zone 1"
      PartChromeType="TitleAndBorder">
        <parttitlestyle font-bold="true" ForeColor="#3300cc" />
        <partstyle
          borderwidth="1px"   
          borderstyle="Solid"  
          bordercolor="#81AAF2" />
        <zonetemplate>
          <aspSample:TextDisplayWebPart 
            runat="server"   
            id="textwebpart" 
            title = "Text Content WebPart" 
            AllowMinimize="false" />
        </zonetemplate>
    </asp:webpartzone>
  </form>
</body>
</html>

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft