WebPartManager Class (System.Web.UI.WebControls.WebParts)


The following code example demonstrates both declarative and programmatic use of the WebPartManager control.

  • A user control that enables you to change display modes on a Web Parts page.

  • A Web page that contains two custom WebPart controls that can be connected, and an <asp:webpartmanager> element.

  • A source code file that contains two custom WebPart controls, and a custom interface.

  • An explanation of how the example works in a browser.

    The user control has a drop-down list control that shows the possible display modes on a page, given the Web Parts controls that are present on the page. In the Web page for this code example, this user control is declared just below the WebPartManager element in the page’s markup, and there is a Register directive near the top of the Web page to register the control. For details about display modes and a description of the source code in this control, see Walkthrough: Changing Display Modes on a Web Parts Page.

    <%@ control language="C#" classname="DisplayModeMenuCS"%>
    <script runat="server">
      
     // Use a field to reference the current WebPartManager.
      WebPartManager _manager;
    
      void Page_Init(object sender, EventArgs e)
      
        Page.InitComplete += new EventHandler(InitComplete);
        
    
      void InitComplete(object sender, System.EventArgs e)
      
        _manager = WebPartManager.GetCurrentWebPartManager(Page);
    
        String browseModeName = WebPartManager.BrowseDisplayMode.Name;
    
        // Fill the dropdown with the names of supported display modes.
        foreach (WebPartDisplayMode mode in _manager.SupportedDisplayModes)
        
          String modeName = mode.Name;
          // Make sure a mode is enabled before adding it.
          if (mode.IsEnabled(_manager))
          
            ListItem item = new ListItem(modeName, modeName);
            DisplayModeDropdown.Items.Add(item);
          
        
    
        // If shared scope is allowed for this user, display the scope-switching
        // UI and select the appropriate radio button for the current user scope.
        if (_manager.Personalization.CanEnterSharedScope)
        
          Panel2.Visible = true;
          if (_manager.Personalization.Scope == PersonalizationScope.User)
            RadioButton1.Checked = true;
          else
            RadioButton2.Checked = true;
        
        
      
     
      // Change the page to the selected display mode.
      void DisplayModeDropdown_SelectedIndexChanged(object sender, EventArgs e)
      
        String selectedMode = DisplayModeDropdown.SelectedValue;
    
        WebPartDisplayMode mode = _manager.SupportedDisplayModes[selectedMode];
        if (mode != null)
          _manager.DisplayMode = mode;
      
    
      // Set the selected item equal to the current display mode.
      void Page_PreRender(object sender, EventArgs e)
      
        ListItemCollection items = DisplayModeDropdown.Items;
        int selectedIndex = 
          items.IndexOf(items.FindByText(_manager.DisplayMode.Name));
        DisplayModeDropdown.SelectedIndex = selectedIndex;
      
    
      // Reset all of a user's personalization data for the page.
      protected void LinkButton1_Click(object sender, EventArgs e)
      
        _manager.Personalization.ResetPersonalizationState();
      
    
      // If not in User personalization scope, toggle into it.
      protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
      
        if (_manager.Personalization.Scope == PersonalizationScope.Shared)
          _manager.Personalization.ToggleScope();
      
    
      // If not in Shared scope, and if user is allowed, toggle the scope.
      protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
      
        if (_manager.Personalization.CanEnterSharedScope && 
            _manager.Personalization.Scope == PersonalizationScope.User)
          _manager.Personalization.ToggleScope();
      
    </script>
    <div>
      <asp:Panel ID="Panel1" runat="server" 
        Borderwidth="1" 
        Width="230" 
        BackColor="lightgray"
        Font-Names="Verdana, Arial, Sans Serif" >
        <asp:Label ID="Label1" runat="server" 
          Text="&nbsp;Display Mode" 
          Font-Bold="true"
          Font-Size="8"
          Width="120" 
          AssociatedControlID="DisplayModeDropdown"/>
        <asp:DropDownList ID="DisplayModeDropdown" runat="server"  
          AutoPostBack="true" 
          Width="120"
          OnSelectedIndexChanged="DisplayModeDropdown_SelectedIndexChanged" />
        <asp:LinkButton ID="LinkButton1" runat="server"
          Text="Reset User State" 
          ToolTip="Reset the current user's personalization data for the page."
          Font-Size="8" 
          OnClick="LinkButton1_Click" />
        <asp:Panel ID="Panel2" runat="server" 
          GroupingText="Personalization Scope"
          Font-Bold="true"
          Font-Size="8" 
          Visible="false" >
          <asp:RadioButton ID="RadioButton1" runat="server" 
            Text="User" 
            AutoPostBack="true"
            GroupName="Scope" OnCheckedChanged="RadioButton1_CheckedChanged" />
          <asp:RadioButton ID="RadioButton2" runat="server" 
            Text="Shared" 
            AutoPostBack="true"
            GroupName="Scope" 
            OnCheckedChanged="RadioButton2_CheckedChanged" />
        </asp:Panel>
      </asp:Panel>
    </div>
    
    <%@ control language="vb" classname="DisplayModeMenuVB"%>
    <script runat="server">
      ' Use a field to reference the current WebPartManager.
      Dim _manager As WebPartManager
    
      Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)
        AddHandler Page.InitComplete, AddressOf InitComplete
      End Sub
    
      Sub InitComplete(ByVal sender As Object, ByVal e As System.EventArgs)
        _manager = WebPartManager.GetCurrentWebPartManager(Page)
          
        Dim browseModeName As String = WebPartManager.BrowseDisplayMode.Name
          
        ' Fill the dropdown with the names of supported display modes.
        Dim mode As WebPartDisplayMode
        For Each mode In _manager.SupportedDisplayModes
          Dim modeName As String = mode.Name
          ' Make sure a mode is enabled before adding it.
          If mode.IsEnabled(_manager) Then
            Dim item As New ListItem(modeName, modeName)
            DisplayModeDropdown.Items.Add(item)
          End If
        Next mode
          
        ' If shared scope is allowed for this user, display the scope-switching
        ' UI and select the appropriate radio button for the current user scope.
        If _manager.Personalization.CanEnterSharedScope Then
          Panel2.Visible = True
          If _manager.Personalization.Scope = PersonalizationScope.User Then
            RadioButton1.Checked = True
          Else
            RadioButton2.Checked = True
          End If
        End If
       
      End Sub
    
      ' Change the page to the selected display mode.
      Sub DisplayModeDropdown_SelectedIndexChanged(ByVal sender As Object, _
        ByVal e As EventArgs)
        
        Dim selectedMode As String = DisplayModeDropdown.SelectedValue   
        Dim mode As WebPartDisplayMode = _
          _manager.SupportedDisplayModes(selectedMode)
        If Not (mode Is Nothing) Then
          _manager.DisplayMode = mode
        End If
    
      End Sub
       
      ' Set the selected item equal to the current display mode.
      Sub Page_PreRender(ByVal sender As Object, ByVal e As EventArgs)
        Dim items As ListItemCollection = DisplayModeDropdown.Items
        Dim selectedIndex As Integer = _
          items.IndexOf(items.FindByText(_manager.DisplayMode.Name))
        DisplayModeDropdown.SelectedIndex = selectedIndex
    
      End Sub
    
      ' Reset all of a user's personalization data for the page.
      Protected Sub LinkButton1_Click(ByVal sender As Object, _
        ByVal e As EventArgs)
        
        _manager.Personalization.ResetPersonalizationState()
        
      End Sub
    
      ' If not in User personalization scope, toggle into it.
      Protected Sub RadioButton1_CheckedChanged(ByVal sender As Object, _
        ByVal e As EventArgs)
        
        If _manager.Personalization.Scope = PersonalizationScope.Shared Then
          _manager.Personalization.ToggleScope()
        End If
    
      End Sub
       
      ' If not in Shared scope, and if user is allowed, toggle the scope.
      Protected Sub RadioButton2_CheckedChanged(ByVal sender As Object, _
        ByVal e As EventArgs)
        
        If _manager.Personalization.CanEnterSharedScope AndAlso _
          _manager.Personalization.Scope = PersonalizationScope.User Then
          _manager.Personalization.ToggleScope()
        End If
    
      End Sub
    
    </script>
    <div>
      <asp:Panel ID="Panel1" runat="server" 
        Borderwidth="1" 
        Width="230" 
        BackColor="lightgray"
        Font-Names="Verdana, Arial, Sans Serif" >
        <asp:Label ID="Label1" runat="server" 
          Text="&nbsp;Display Mode" 
          Font-Bold="true"
          Font-Size="8"
          Width="120" 
          AssociatedControlID="DisplayModeDropdown"/>
        <asp:DropDownList ID="DisplayModeDropdown" runat="server"  
          AutoPostBack="true" 
          Width="120"
          OnSelectedIndexChanged="DisplayModeDropdown_SelectedIndexChanged" />
        <asp:LinkButton ID="LinkButton1" runat="server"
          Text="Reset User State" 
          ToolTip="Reset the current user's personalization data for the page."
          Font-Size="8" 
          OnClick="LinkButton1_Click" />
        <asp:Panel ID="Panel2" runat="server" 
          GroupingText="Personalization Scope"
          Font-Bold="true"
          Font-Size="8" 
          Visible="false" >
          <asp:RadioButton ID="RadioButton1" runat="server" 
            Text="User" 
            AutoPostBack="true"
            GroupName="Scope" OnCheckedChanged="RadioButton1_CheckedChanged" />
          <asp:RadioButton ID="RadioButton2" runat="server" 
            Text="Shared" 
            AutoPostBack="true"
            GroupName="Scope" 
            OnCheckedChanged="RadioButton2_CheckedChanged" />
        </asp:Panel>
      </asp:Panel>
    </div>
    

    The declarative markup for the Web page contains Register directives for both the user control and the custom controls. There is an <asp:webpartmanager> element, an <asp:webpartzone> element to contain the custom controls, and an <asp:connectionszone> element. The page also contains some inline code that handles connection-related events for the WebPartManager control; you can see the effect of this code as you connect and disconnect controls.

    <%@ Page Language="C#" %>
    <%@ register TagPrefix="uc1" 
      TagName="DisplayModeMenuCS" 
      Src="DisplayModeMenuCS.ascx" %>
    <%@ register tagprefix="aspSample" 
      Namespace="Samples.AspNet.CS.Controls" 
      Assembly="ConnectionSampleCS" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
     
      private void UpdateLabelData(int wpCount, int connCount)
      
        Label1.Text = "WebPart Control Count:  " + wpCount.ToString();
        Label2.Text = "Connections Count: " + connCount.ToString();
      
    
      protected void WebPartManager1_WebPartsConnected(object sender, WebPartConnectionsEventArgs e)
      
        UpdateLabelData(WebPartManager1.WebParts.Count,
          WebPartManager1.Connections.Count);
      
    
      protected void WebPartManager1_WebPartsDisconnected(object sender, WebPartConnectionsEventArgs e)
      
        UpdateLabelData(WebPartManager1.WebParts.Count,
          WebPartManager1.Connections.Count);
      
      
    </script>
    
    <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">
          <!-- Reference the WebPartManager control. -->
          <asp:WebPartManager ID="WebPartManager1" runat="server"  
            OnWebPartsConnected="WebPartManager1_WebPartsConnected" 
            OnWebPartsDisconnected="WebPartManager1_WebPartsDisconnected" />
        <div>
          <uc1:DisplayModeMenuCS ID="displaymode1" runat="server" />
          <!-- Reference consumer and provider controls in a zone. -->
          <asp:WebPartZone ID="WebPartZone1" runat="server">
            <ZoneTemplate>
              <aspSample:ZipCodeWebPart ID="zip1" 
                runat="server" 
                Title="Zip Code Control"/>
              <aspSample:WeatherWebPart ID="weather1" 
                runat="server" 
                Title="Weather Control" />
            </ZoneTemplate>
          </asp:WebPartZone>
          <hr />
          <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
          <br />
          <asp:Label ID="Label2" runat="server" Text=""></asp:Label>
          <!-- Add a ConnectionsZone so users can connect controls. -->
          <asp:ConnectionsZone ID="ConnectionsZone1" runat="server" />
        </div>
        </form>
    </body>
    </html>
    
    <%@ Page Language="vb" %>
    <%@ register TagPrefix="uc1" 
      TagName="DisplayModeMenuVB" 
      Src="DisplayModeMenuVB.ascx" %>
    <%@ register tagprefix="aspSample" 
      Namespace="Samples.AspNet.VB.Controls" 
      Assembly="ConnectionSampleVB" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
    
      Protected Sub WebPartManager1_WebPartsConnected( _
        ByVal sender As Object, _
        ByVal e As System.Web.UI.WebControls.WebParts.WebPartConnectionsEventArgs)
        
        UpdateLabelData(WebPartManager1.WebParts.Count, _
          WebPartManager1.Connections.Count)
        
      End Sub
    
      Protected Sub WebPartManager1_WebPartsDisconnected( _
        ByVal sender As Object, _
        ByVal e As System.Web.UI.WebControls.WebParts.WebPartConnectionsEventArgs)
        
        UpdateLabelData(WebPartManager1.WebParts.Count, _
          WebPartManager1.Connections.Count)
        
      End Sub
      
      Private Sub UpdateLabelData(ByVal wpCount As Integer, _
        ByVal connCount As Integer)
        
        Label1.Text = "WebPart Control Count:  " & wpCount.ToString()
        Label2.Text = "Connections Count: " & connCount.ToString()
        
      End Sub
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>ASP.NET Example</title>
    </head>
    <body>
        <form id="form1" runat="server">
          <!-- Reference the WebPartManager control. -->
          <asp:WebPartManager ID="WebPartManager1" runat="server" OnWebPartsConnected="WebPartManager1_WebPartsConnected" OnWebPartsDisconnected="WebPartManager1_WebPartsDisconnected" />
        <div>
          <uc1:DisplayModeMenuVB ID="displaymode1" runat="server" />
          <!-- Reference consumer and provider controls in a zone. -->
          <asp:WebPartZone ID="WebPartZone1" runat="server">
            <ZoneTemplate>
              <aspSample:ZipCodeWebPart ID="zip1" 
                runat="server" 
                Title="Zip Code Control"/>
              <aspSample:WeatherWebPart ID="weather1" 
                runat="server" 
                Title="Weather Control" />
            </ZoneTemplate>
          </asp:WebPartZone>
          <hr />
          <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
          <br />
          <asp:Label ID="Label2" runat="server" Text=""></asp:Label>
          <!-- Add a ConnectionsZone so users can connect controls. -->
          <asp:ConnectionsZone ID="ConnectionsZone1" runat="server" />
        </div>
        </form>
    </body>
    </html>
    

    The third part of the example is the source code for the controls. Note that there is an interface named IZipCode, and this interface is implemented in the ZipCodeWebPart class. This class has a special callback method named ProvideIZipCode that serves as a provider. The other type, named WeatherWebPart, is also implemented with a special method named GetIZipCode, which enables the control to act as a consumer of the other control.

    For the code example to run, you must compile this source code. You can compile it explicitly and put the resulting assembly in your Web site’s Bin folder or the global assembly cache. Alternatively, you can put the source code in your site’s App_Code folder, where it will be dynamically compiled at run time. This code example assumes that you have compiled the source into an assembly, and the Register directive in the Web page references the assembly name. For a walkthrough that demonstrates how to compile, see Walkthrough: Developing and Using a Custom Web Server Control.

    namespace Samples.AspNet.CS.Controls
    
      using System;
      using System.Web;
      using System.Web.Security;
      using System.Security.Permissions;
      using System.Web.UI;
      using System.Web.UI.WebControls;
      using System.Web.UI.WebControls.WebParts;
    
      [AspNetHostingPermission(SecurityAction.Demand,
        Level = AspNetHostingPermissionLevel.Minimal)]
      [AspNetHostingPermission(SecurityAction.InheritanceDemand,
        Level = AspNetHostingPermissionLevel.Minimal)]
      public interface IZipCode
      
        string ZipCode  get; set;
      
    
      [AspNetHostingPermission(SecurityAction.Demand,
        Level = AspNetHostingPermissionLevel.Minimal)]
      [AspNetHostingPermission(SecurityAction.InheritanceDemand,
        Level = AspNetHostingPermissionLevel.Minimal)]
      public class ZipCodeWebPart : WebPart, IZipCode
      
        string zipCodeText = String.Empty;
        TextBox input;
        Button send;
    
        public ZipCodeWebPart()
        
        
    
        // Make the implemented property personalizable to save 
        // the Zip Code between browser sessions.
        [Personalizable()]
        public virtual string ZipCode
        
          get  return zipCodeText; 
          set  zipCodeText = value; 
        
    
        // This is the callback method that returns the provider.
        [ConnectionProvider("Zip Code")]
        public IZipCode ProvideIZipCode()
        
          return this;
        
    
        protected override void CreateChildControls()
        
          Controls.Clear();
          input = new TextBox();
          this.Controls.Add(input);
          send = new Button();
          send.Text = "Enter 5-digit Zip Code";
          send.Click += new EventHandler(this.submit_Click);
          this.Controls.Add(send);
        
    
        private void submit_Click(object sender, EventArgs e)
        
          if (!string.IsNullOrEmpty(input.Text))
          
            zipCodeText = Page.Server.HtmlEncode(input.Text);
            input.Text = String.Empty;
          
        
    
      
    
      [AspNetHostingPermission(SecurityAction.Demand,
        Level = AspNetHostingPermissionLevel.Minimal)]
      [AspNetHostingPermission(SecurityAction.InheritanceDemand,
        Level = AspNetHostingPermissionLevel.Minimal)]
      public class WeatherWebPart : WebPart
      
        private IZipCode _provider;
        string _zipSearch;
        Label DisplayContent;
    
        // This method is identified by the ConnectionConsumer 
        // attribute, and is the mechanism for connecting with 
        // the provider. 
        [ConnectionConsumer("Zip Code")]
        public void GetIZipCode(IZipCode Provider)
        
          _provider = Provider;
        
        
        protected override void OnPreRender(EventArgs e)
        
          EnsureChildControls();
    
          if (this._provider != null)
          
            _zipSearch = _provider.ZipCode.Trim();
            DisplayContent.Text = "My Zip Code is:  " + _zipSearch;
          
        
    
        protected override void CreateChildControls()
        
          Controls.Clear();
          DisplayContent = new Label();
          this.Controls.Add(DisplayContent);
        
    
      
    
    
    Imports System
    Imports System.Web
    Imports System.Web.Security
    Imports System.Security.Permissions
    Imports System.Web.UI
    Imports System.Web.UI.WebControls
    Imports System.Web.UI.WebControls.WebParts
    
    Namespace Samples.AspNet.VB.Controls
    
      <AspNetHostingPermission(SecurityAction.Demand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
      <AspNetHostingPermission(SecurityAction.InheritanceDemand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
      Public Interface IZipCode
    
        Property ZipCode() As String
    
      End Interface
    
      <AspNetHostingPermission(SecurityAction.Demand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
      <AspNetHostingPermission(SecurityAction.InheritanceDemand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
      Public Class ZipCodeWebPart
        Inherits WebPart
        Implements IZipCode
        Private zipCodeText As String = String.Empty
        Private input As TextBox
        Private send As Button
    
        Public Sub New()
        End Sub
    
        ' Make the implemented property personalizable to save 
        ' the Zip Code between browser sessions.
        <Personalizable()> _
        Public Property ZipCode() As String _
          Implements IZipCode.ZipCode
    
          Get
            Return zipCodeText
          End Get
          Set(ByVal value As String)
            zipCodeText = value
          End Set
        End Property
    
        ' This is the callback method that returns the provider.
        <ConnectionProvider("Zip Code")> _
        Public Function ProvideIZipCode() As IZipCode
          Return Me
        End Function
    
    
        Protected Overrides Sub CreateChildControls()
          Controls.Clear()
          input = New TextBox()
          Me.Controls.Add(input)
          send = New Button()
          send.Text = "Enter 5-digit Zip Code"
          AddHandler send.Click, AddressOf Me.submit_Click
          Me.Controls.Add(send)
    
        End Sub
    
    
        Private Sub submit_Click(ByVal sender As Object, _
          ByVal e As EventArgs)
    
          If input.Text <> String.Empty Then
            zipCodeText = Page.Server.HtmlEncode(input.Text)
            input.Text = String.Empty
          End If
    
        End Sub
    
      End Class
    
      <AspNetHostingPermission(SecurityAction.Demand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
      <AspNetHostingPermission(SecurityAction.InheritanceDemand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
      Public Class WeatherWebPart
        Inherits WebPart
        Private _provider As IZipCode
        Private _zipSearch As String
        Private DisplayContent As Label
    
        ' This method is identified by the ConnectionConsumer 
        ' attribute, and is the mechanism for connecting with 
        ' the provider. 
        <ConnectionConsumer("Zip Code")> _
        Public Sub GetIZipCode(ByVal Provider As IZipCode)
          _provider = Provider
        End Sub
    
    
        Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
          EnsureChildControls()
    
          If Not (Me._provider Is Nothing) Then
            _zipSearch = _provider.ZipCode.Trim()
    	DisplayContent.Text = "My Zip Code is:  " + _zipSearch
          End If
    
        End Sub 'OnPreRender
    
        Protected Overrides Sub CreateChildControls()
          Controls.Clear()
          DisplayContent = New Label()
          Me.Controls.Add(DisplayContent)
    
        End Sub
    
      End Class
    
    End Namespace
    

    After you have loaded the Web page in a browser, click the Display Mode drop-down list control and select Connect to switch the page to connect mode. Connect mode uses the <asp:connectionszone> element to enable you to create connections between controls. In connect mode, click the downward arrow in the title bar of the ZIP Code control to activate its verbs menu, and then click Connect. After the connection UI appears, click the Create a connection to a Consumer link. A cell appears that has a drop-down list control. Select Weather Control in the drop-down list, and then click Connect to complete the connection of the two controls. Click Close, and then use the Display Mode drop-down list to return the page to normal browse mode. You can enter a ZIP Code, and the consumer control will be updated with the value you enter. Because the ZipCode property was marked with the Personalizable attribute in the source code, this property value will persist across browser sessions, thus saving the value entered by a user. A more sophisticated consumer control could take the ZIP code information, look up weather information based on the code, and display it to a user.

  • The WebPartManager control acts as the hub or control center of a Web Parts application. There must be one–and only one–WebPartManager control instance on every page that uses Web Parts controls. As with most aspects of Web Parts applications, the WebPartManager control works only with authenticated users. Further, its functionality works almost entirely with server controls that reside within Web Parts zones that inherit from the WebZone class. Server controls that reside on a page outside of these zones can have very little Web Parts functionality or interaction with the WebPartManager control.

    As the hub for Web Parts functionality on a page, the WebPartManager control carries out the kinds of tasks described in the following table.

    The WebPartManager class overrides some of its base inherited properties, which are used by many Web server controls. These include the EnableTheming, SkinID, and Visible properties.

    Finally, there is a group of properties useful for accessing the current state of the application. The DisplayMode property indicates the current display mode that a page is in. The EnableClientScript property indicates whether a control is allowed to render client-side script, which is relevant in situations where users might have browsers with different capabilities or have scripting turned off. The Internals property is useful for referencing a utility class that contains the calls to a number of important Web Parts methods that are used for extensibility cases. By hiding the calls to these methods in a separate class (the WebPartManagerInternals class), the WebPartManager class’s own API is simplified. The Personalization property provides access to the personalization objects that store users’ personalization settings and persist that data to permanent storage. The SelectedWebPart property indicates which WebPart control on a page is currently selected by the user or the application. The IPersonalizable.IsDirty property indicates whether custom personalization data on a WebPart control has changed.

    The WebPartManager control contains five built-in display modes, or views of a Web page. Developers can extend this feature, creating custom display modes by extending types such as the WebZone class or the ToolZone class. Users can switch a page into the various display modes, provided that the proper kind of controls that correspond to a given display mode are present on a page.

    The standard display modes are represented by public fields in the WebPartManager class. The following table summarizes the fields and the display modes they refer to. The current display mode of a page, as noted above, is always referenced in the DisplayMode property, and the set of display modes that is possible on a particular page, given the kind of zones that are present on the page, is contained in the SupportedDisplayModes property.

    The WebPartManager control also contains a number of events that are critical in the life cycle of Web Parts pages and controls. These events provide precise programmatic control over the behavior of Web Parts controls. Most methods pertain directly to WebPart controls (or other server or user controls that are placed in WebPartZoneBase zones so that they can behave as WebPart controls). However, a few events pertain to the state of the page or connections on the page. The following table lists the available events and summarizes their purposes.

    The WebPartManager control has numerous methods for managing Web Parts pages. A large set of the methods, not listed here, are methods whose names take the form of OnEventName. These methods typically raise their associated event, and provide the event with a handler of type WebPartEventHandler. Most of these methods can be overridden by developers who inherit from the WebPartManager class. Also, page developers can provide custom handlers for the events associated with these methods. For example, in the case of the WebPartAdded event, a page developer could add an OnWebPartAdded attribute to the <asp:webpartmanager> element in the markup of a Web page, and then assign a custom method name to the attribute to provide custom handling for the event. The attribute corresponds to the OnWebPartAdded method, and this basic pattern of event handling works for most Web Parts events and their associated methods.

    The WebPartManager control is designed to be extended. Because it is so central to Web Parts applications, when you want to extend some specific type or control in the Web Parts control set, in many cases you must also extend the WebPartManager class, because it is likely to have some property or method that is required to make your custom type work in the context of a Web Parts application. The Web Parts reference documentation (see System.Web.UI.WebControls.WebParts), when discussing how to extend a Web Parts type, frequently mentions what needs to be done to extend the WebPartManager class as well, or shows how to extend it in a code example.



    Adapter
    Adapter
    Adapter
    Adapter

    Gets the browser-specific adapter for the control.

    (Inherited from Control)



    AppRelativeTemplateSourceDirectory
    AppRelativeTemplateSourceDirectory
    AppRelativeTemplateSourceDirectory
    AppRelativeTemplateSourceDirectory

    Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control.

    (Inherited from Control)



    AvailableTransformers
    AvailableTransformers
    AvailableTransformers
    AvailableTransformers

    Gets a collection of WebPartTransformer objects that are available for use in creating Web Parts connections between server controls.



    BindingContainer
    BindingContainer
    BindingContainer
    BindingContainer

    Gets the control that contains this control’s data binding.

    (Inherited from Control)



    ChildControlsCreated
    ChildControlsCreated
    ChildControlsCreated
    ChildControlsCreated

    Gets a value that indicates whether the server control’s child controls have been created.

    (Inherited from Control)



    ClientID
    ClientID
    ClientID
    ClientID

    Gets the control ID for HTML markup that is generated by ASP.NET.

    (Inherited from Control)



    ClientIDMode
    ClientIDMode
    ClientIDMode
    ClientIDMode

    Gets or sets the algorithm that is used to generate the value of the ClientID property.

    (Inherited from Control)



    ClientIDSeparator
    ClientIDSeparator
    ClientIDSeparator
    ClientIDSeparator

    Gets a character value representing the separator character used in the ClientID property.

    (Inherited from Control)



    CloseProviderWarning
    CloseProviderWarning
    CloseProviderWarning
    CloseProviderWarning

    Gets or sets a warning that is displayed when a user closes a control that is acting as a provider to other controls in a connection.



    Connections
    Connections
    Connections
    Connections

    Gets a reference to the collection of all current connections on a Web page.



    Context
    Context
    Context
    Context

    Gets the HttpContext object associated with the server control for the current Web request.

    (Inherited from Control)



    Controls
    Controls
    Controls
    Controls

    Gets the collection of all WebPart, server, or user controls that are contained in WebPartZoneBase zones on a Web page and are managed by the WebPartManager control.



    DataItemContainer
    DataItemContainer
    DataItemContainer
    DataItemContainer

    Gets a reference to the naming container if the naming container implements IDataItemContainer.

    (Inherited from Control)



    DataKeysContainer
    DataKeysContainer
    DataKeysContainer
    DataKeysContainer

    Gets a reference to the naming container if the naming container implements IDataKeysControl.

    (Inherited from Control)



    DeleteWarning
    DeleteWarning
    DeleteWarning
    DeleteWarning

    Gets or sets a custom warning message displayed to end users when they delete a control.



    DesignMode
    DesignMode
    DesignMode
    DesignMode

    Gets a value indicating whether a control is being used on a design surface.

    (Inherited from Control)



    DisplayMode
    DisplayMode
    DisplayMode
    DisplayMode

    Gets or sets the active display mode for a Web page that contains Web Parts controls.



    DisplayModes
    DisplayModes
    DisplayModes
    DisplayModes

    Gets a read-only collection of all display modes that are associated with a WebPartManager control.



    DynamicConnections
    DynamicConnections
    DynamicConnections
    DynamicConnections

    Gets the collection of all dynamic connections that currently exist on a Web page.



    EnableClientScript
    EnableClientScript
    EnableClientScript
    EnableClientScript

    Gets or sets a value that determines whether client-side scripting is enabled on the Web page that contains a WebPartManager control.



    EnableTheming
    EnableTheming
    EnableTheming
    EnableTheming

    Gets a value indicating that the use of themes is enabled on a Web page.



    EnableViewState
    EnableViewState
    EnableViewState
    EnableViewState

    Gets or sets a value indicating whether the server control persists its view state, and the view state of any child controls it contains, to the requesting client.

    (Inherited from Control)



    Events
    Events
    Events
    Events

    Gets a list of event handler delegates for the control. This property is read-only.

    (Inherited from Control)



    ExportSensitiveDataWarning
    ExportSensitiveDataWarning
    ExportSensitiveDataWarning
    ExportSensitiveDataWarning

    Gets or sets the text of a warning message that is displayed when a user attempts to export sensitive state data from a WebPart control.



    HasChildViewState
    HasChildViewState
    HasChildViewState
    HasChildViewState

    Gets a value indicating whether the current server control’s child controls have any saved view-state settings.

    (Inherited from Control)



    IControlBuilderAccessor.ControlBuilder
    IControlBuilderAccessor.ControlBuilder
    IControlBuilderAccessor.ControlBuilder
    IControlBuilderAccessor.ControlBuilder

    For a description of this member, see ControlBuilder.

    (Inherited from Control)



    IControlDesignerAccessor.UserData
    IControlDesignerAccessor.UserData
    IControlDesignerAccessor.UserData
    IControlDesignerAccessor.UserData

    For a description of this member, see UserData.

    (Inherited from Control)



    ID
    ID
    ID
    ID

    Gets or sets the programmatic identifier assigned to the server control.

    (Inherited from Control)



    IDataBindingsAccessor.DataBindings
    IDataBindingsAccessor.DataBindings
    IDataBindingsAccessor.DataBindings
    IDataBindingsAccessor.DataBindings

    For a description of this member, see DataBindings.

    (Inherited from Control)



    IDataBindingsAccessor.HasDataBindings
    IDataBindingsAccessor.HasDataBindings
    IDataBindingsAccessor.HasDataBindings
    IDataBindingsAccessor.HasDataBindings

    For a description of this member, see HasDataBindings.

    (Inherited from Control)



    IdSeparator
    IdSeparator
    IdSeparator
    IdSeparator

    Gets the character used to separate control identifiers.

    (Inherited from Control)



    IExpressionsAccessor.Expressions
    IExpressionsAccessor.Expressions
    IExpressionsAccessor.Expressions
    IExpressionsAccessor.Expressions

    For a description of this member, see Expressions.

    (Inherited from Control)



    IExpressionsAccessor.HasExpressions
    IExpressionsAccessor.HasExpressions
    IExpressionsAccessor.HasExpressions
    IExpressionsAccessor.HasExpressions

    For a description of this member, see HasExpressions.

    (Inherited from Control)



    Internals
    Internals
    Internals
    Internals

    Gets a reference to the WebPartManagerInternals class, which is used to combine and separate a set of methods that are actually implemented in the WebPartManager class, but are mostly useful for control developers.



    IsChildControlStateCleared
    IsChildControlStateCleared
    IsChildControlStateCleared
    IsChildControlStateCleared

    Gets a value indicating whether controls contained within this control have control state.

    (Inherited from Control)



    IsCustomPersonalizationStateDirty
    IsCustomPersonalizationStateDirty
    IsCustomPersonalizationStateDirty
    IsCustomPersonalizationStateDirty

    Gets a value that indicates whether personalization changes have been made that affect page-level personalization details controlled by the WebPartManager control.



    IsTrackingViewState
    IsTrackingViewState
    IsTrackingViewState
    IsTrackingViewState

    Gets a value that indicates whether the server control is saving changes to its view state.

    (Inherited from Control)



    IsViewStateEnabled
    IsViewStateEnabled
    IsViewStateEnabled
    IsViewStateEnabled

    Gets a value indicating whether view state is enabled for this control.

    (Inherited from Control)



    LoadViewStateByID
    LoadViewStateByID
    LoadViewStateByID
    LoadViewStateByID

    Gets a value indicating whether the control participates in loading its view state by ID instead of index.

    (Inherited from Control)



    MediumPermissionSet
    MediumPermissionSet
    MediumPermissionSet
    MediumPermissionSet

    Gets a PermissionSet object that allows only Execution permission and Medium permission.



    MinimalPermissionSet
    MinimalPermissionSet
    MinimalPermissionSet
    MinimalPermissionSet

    Gets a PermissionSet object that allows only Execution permission and Minimal permission.



    NamingContainer
    NamingContainer
    NamingContainer
    NamingContainer

    Gets a reference to the server control’s naming container, which creates a unique namespace for differentiating between server controls with the same ID property value.

    (Inherited from Control)



    Page
    Page
    Page
    Page

    Gets a reference to the Page instance that contains the server control.

    (Inherited from Control)



    Parent
    Parent
    Parent
    Parent

    Gets a reference to the server control’s parent control in the page control hierarchy.

    (Inherited from Control)



    Personalization
    Personalization
    Personalization
    Personalization

    Gets a reference to an object that contains personalization data for a Web page.



    RenderingCompatibility
    RenderingCompatibility
    RenderingCompatibility
    RenderingCompatibility

    Gets a value that specifies the ASP.NET version that rendered HTML will be compatible with.

    (Inherited from Control)



    SelectedWebPart
    SelectedWebPart
    SelectedWebPart
    SelectedWebPart

    Gets a reference to a WebPart or other server control that is currently selected for editing or for creating a connection with another control.



    Site
    Site
    Site
    Site

    Gets information about the container that hosts the current control when rendered on a design surface.

    (Inherited from Control)



    SkinID
    SkinID
    SkinID
    SkinID

    Gets or sets an empty string (“”) so that no skin can be applied to the WebPartManager control.



    StaticConnections
    StaticConnections
    StaticConnections
    StaticConnections

    Gets a reference to the collection of all WebPartConnection objects on a Web page that are defined as static connections.



    SupportedDisplayModes
    SupportedDisplayModes
    SupportedDisplayModes
    SupportedDisplayModes

    Gets a read-only collection of all display modes that are available on a particular Web page.



    TemplateControl
    TemplateControl
    TemplateControl
    TemplateControl

    Gets or sets a reference to the template that contains this control.

    (Inherited from Control)



    TemplateSourceDirectory
    TemplateSourceDirectory
    TemplateSourceDirectory
    TemplateSourceDirectory

    Gets the virtual directory of the Page or UserControl that contains the current server control.

    (Inherited from Control)



    UniqueID
    UniqueID
    UniqueID
    UniqueID

    Gets the unique, hierarchically qualified identifier for the server control.

    (Inherited from Control)



    ValidateRequestMode
    ValidateRequestMode
    ValidateRequestMode
    ValidateRequestMode

    Gets or sets a value that indicates whether the control checks client input from the browser for potentially dangerous values.

    (Inherited from Control)



    ViewState
    ViewState
    ViewState
    ViewState

    Gets a dictionary of state information that allows you to save and restore the view state of a server control across multiple requests for the same page.

    (Inherited from Control)



    ViewStateIgnoresCase
    ViewStateIgnoresCase
    ViewStateIgnoresCase
    ViewStateIgnoresCase

    Gets a value that indicates whether the StateBag object is case-insensitive.

    (Inherited from Control)



    ViewStateMode
    ViewStateMode
    ViewStateMode
    ViewStateMode

    Gets or sets the view-state mode of this control.

    (Inherited from Control)



    Visible
    Visible
    Visible
    Visible

    Gets a value that enables child controls to be visible.



    WebParts
    WebParts
    WebParts
    WebParts

    Gets a reference to all WebPart controls tracked by the WebPartManager control on a Web page.



    Zones
    Zones
    Zones
    Zones

    Gets a reference to a collection of all the WebPartZoneBase zones on a Web page.




    ActivateConnections()
    ActivateConnections()
    ActivateConnections()
    ActivateConnections()

    Makes active all connections on a Web page that are currently inactive.



    AddedControl(Control, Int32)
    AddedControl(Control, Int32)
    AddedControl(Control, Int32)
    AddedControl(Control, Int32)

    Called after a child control is added to the Controls collection of the Control object.

    (Inherited from Control)



    AddParsedSubObject(Object)
    AddParsedSubObject(Object)
    AddParsedSubObject(Object)
    AddParsedSubObject(Object)

    Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control’s ControlCollection object.

    (Inherited from Control)



    AddWebPart(WebPart, WebPartZoneBase, Int32)
    AddWebPart(WebPart, WebPartZoneBase, Int32)
    AddWebPart(WebPart, WebPartZoneBase, Int32)
    AddWebPart(WebPart, WebPartZoneBase, Int32)

    Provides the standard programmatic method for adding WebPart controls to a Web page.



    ApplyStyleSheetSkin(Page)
    ApplyStyleSheetSkin(Page)
    ApplyStyleSheetSkin(Page)
    ApplyStyleSheetSkin(Page)

    Applies the style properties defined in the page style sheet to the control.

    (Inherited from Control)



    BeginRenderTracing(TextWriter, Object)
    BeginRenderTracing(TextWriter, Object)
    BeginRenderTracing(TextWriter, Object)
    BeginRenderTracing(TextWriter, Object)

    Begins design-time tracing of rendering data.

    (Inherited from Control)



    BeginWebPartConnecting(WebPart)
    BeginWebPartConnecting(WebPart)
    BeginWebPartConnecting(WebPart)
    BeginWebPartConnecting(WebPart)

    Starts the process of connecting two WebPart controls.



    BeginWebPartEditing(WebPart)
    BeginWebPartEditing(WebPart)
    BeginWebPartEditing(WebPart)
    BeginWebPartEditing(WebPart)

    Starts the process of editing a WebPart control.



    BuildProfileTree(String, Boolean)
    BuildProfileTree(String, Boolean)
    BuildProfileTree(String, Boolean)
    BuildProfileTree(String, Boolean)

    Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page.

    (Inherited from Control)



    CanConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint)
    CanConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint)
    CanConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint)
    CanConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint)

    Checks the WebPart controls that will be participating in a connection to determine whether they are capable of being connected, when the consumer and provider controls have compatible interfaces and a WebPartTransformer object is not needed.



    CanConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)
    CanConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)
    CanConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)
    CanConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)

    Checks the WebPart controls that will be participating in a connection to determine whether they are capable of being connected, and uses a WebPartTransformer object to create the connection between an incompatible consumer and provider.



    CheckRenderClientScript()
    CheckRenderClientScript()
    CheckRenderClientScript()
    CheckRenderClientScript()

    Checks the capabilities of the browser making the request, and the value of the EnableClientScript property, to determine whether to render client script.



    ClearCachedClientID()
    ClearCachedClientID()
    ClearCachedClientID()
    ClearCachedClientID()

    Sets the cached ClientID value to null.

    (Inherited from Control)



    ClearChildControlState()
    ClearChildControlState()
    ClearChildControlState()
    ClearChildControlState()

    Deletes the control-state information for the server control’s child controls.

    (Inherited from Control)



    ClearChildState()
    ClearChildState()
    ClearChildState()
    ClearChildState()

    Deletes the view-state and control-state information for all the server control’s child controls.

    (Inherited from Control)



    ClearChildViewState()
    ClearChildViewState()
    ClearChildViewState()
    ClearChildViewState()

    Deletes the view-state information for all the server control’s child controls.

    (Inherited from Control)



    ClearEffectiveClientIDMode()
    ClearEffectiveClientIDMode()
    ClearEffectiveClientIDMode()
    ClearEffectiveClientIDMode()

    Sets the ClientIDMode property of the current control instance and of any child controls to Inherit.

    (Inherited from Control)



    CloseWebPart(WebPart)
    CloseWebPart(WebPart)
    CloseWebPart(WebPart)
    CloseWebPart(WebPart)

    Closes a WebPart control in such a way that it is not rendered on a Web page, but can be reopened.



    ConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint)
    ConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint)
    ConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint)
    ConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint)

    Creates a connection between two WebPart or GenericWebPart controls using only the references to the controls and their specified ConnectionPoint objects.



    ConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)
    ConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)
    ConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)
    ConnectWebParts(WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint, WebPartTransformer)

    Creates a connection between two WebPart or GenericWebPart controls using the references to the controls, their specified ConnectionPoint objects, and a WebPartTransformer object.



    CopyWebPart(WebPart)
    CopyWebPart(WebPart)
    CopyWebPart(WebPart)
    CopyWebPart(WebPart)

    Used by the Web Parts control set to create a copy of a WebPart or server control for the purpose of adding the control to a Web page.



    CreateAvailableTransformers()
    CreateAvailableTransformers()
    CreateAvailableTransformers()
    CreateAvailableTransformers()

    Creates a set of transformers specified in a Web site’s configuration file and adds them to the collection of transformers referenced by the AvailableTransformers property.



    CreateChildControls()
    CreateChildControls()
    CreateChildControls()
    CreateChildControls()

    Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.

    (Inherited from Control)



    CreateControlCollection()
    CreateControlCollection()
    CreateControlCollection()
    CreateControlCollection()

    Returns the collection of all controls that are managed by the WebPartManager control on a Web page. This class cannot be inherited.



    CreateDisplayModes()
    CreateDisplayModes()
    CreateDisplayModes()
    CreateDisplayModes()

    Creates the set of all possible display modes for a Web Parts application.



    CreateDynamicConnectionID()
    CreateDynamicConnectionID()
    CreateDynamicConnectionID()
    CreateDynamicConnectionID()

    Gets a unique value to serve as an ID for a dynamic connection.



    CreateDynamicWebPartID(Type)
    CreateDynamicWebPartID(Type)
    CreateDynamicWebPartID(Type)
    CreateDynamicWebPartID(Type)

    Generates a unique ID for a dynamic WebPart control.



    CreateErrorWebPart(String, String, String, String, String)
    CreateErrorWebPart(String, String, String, String, String)
    CreateErrorWebPart(String, String, String, String, String)
    CreateErrorWebPart(String, String, String, String, String)

    Creates a special control that is inserted into a page and displayed for end users, when an attempt to load or create a dynamic WebPart control fails for some reason.



    CreatePersonalization()
    CreatePersonalization()
    CreatePersonalization()
    CreatePersonalization()

    Returns a personalization object to contain a user’s personalization data for the current Web page.



    CreateWebPart(Control)
    CreateWebPart(Control)
    CreateWebPart(Control)
    CreateWebPart(Control)

    Wraps a server control that is not a WebPart control with a GenericWebPart object, so that the control can have Web Parts functionality.



    DataBind()
    DataBind()
    DataBind()
    DataBind()

    Binds a data source to the invoked server control and all its child controls.

    (Inherited from Control)



    DataBind(Boolean)
    DataBind(Boolean)
    DataBind(Boolean)
    DataBind(Boolean)

    Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event.

    (Inherited from Control)



    DataBindChildren()
    DataBindChildren()
    DataBindChildren()
    DataBindChildren()

    Binds a data source to the server control’s child controls.

    (Inherited from Control)



    DeleteWebPart(WebPart)
    DeleteWebPart(WebPart)
    DeleteWebPart(WebPart)
    DeleteWebPart(WebPart)

    Permanently removes a dynamic instance of a WebPart control from a Web page.



    DisconnectWebPart(WebPart)
    DisconnectWebPart(WebPart)
    DisconnectWebPart(WebPart)
    DisconnectWebPart(WebPart)

    Removes a WebPart or server control that is being closed or deleted from any connections it is participating in.



    DisconnectWebParts(WebPartConnection)
    DisconnectWebParts(WebPartConnection)
    DisconnectWebParts(WebPartConnection)
    DisconnectWebParts(WebPartConnection)

    Carries out the process of disconnecting server controls that are connected on a Web page.



    Dispose()
    Dispose()
    Dispose()
    Dispose()

    Enables a server control to perform final clean up before it is released from memory.

    (Inherited from Control)



    EndRenderTracing(TextWriter, Object)
    EndRenderTracing(TextWriter, Object)
    EndRenderTracing(TextWriter, Object)
    EndRenderTracing(TextWriter, Object)

    Ends design-time tracing of rendering data.

    (Inherited from Control)



    EndWebPartConnecting()
    EndWebPartConnecting()
    EndWebPartConnecting()
    EndWebPartConnecting()

    Completes the process of connecting a WebPart control to another control.



    EndWebPartEditing()
    EndWebPartEditing()
    EndWebPartEditing()
    EndWebPartEditing()

    Completes the process of editing a WebPart control.



    EnsureChildControls()
    EnsureChildControls()
    EnsureChildControls()
    EnsureChildControls()

    Determines whether the server control contains child controls. If it does not, it creates child controls.

    (Inherited from Control)



    EnsureID()
    EnsureID()
    EnsureID()
    EnsureID()

    Creates an identifier for controls that do not have an identifier assigned.

    (Inherited from Control)



    Equals(Object)
    Equals(Object)
    Equals(Object)
    Equals(Object)

    Determines whether the specified object is equal to the current object.

    (Inherited from Object)



    ExportWebPart(WebPart, XmlWriter)
    ExportWebPart(WebPart, XmlWriter)
    ExportWebPart(WebPart, XmlWriter)
    ExportWebPart(WebPart, XmlWriter)

    Creates an XML description file that contains state and property data for a server control.



    FindControl(String)
    FindControl(String)
    FindControl(String)
    FindControl(String)

    Searches the current naming container for a server control with the specified id parameter.

    (Inherited from Control)



    FindControl(String, Int32)
    FindControl(String, Int32)
    FindControl(String, Int32)
    FindControl(String, Int32)

    Searches the current naming container for a server control with the specified id and an integer, specified in the pathOffset parameter, which aids in the search. You should not override this version of the FindControl method.

    (Inherited from Control)



    Focus()
    Focus()
    Focus()
    Focus()

    Overridden to prevent focus from ever being set on the WebPartManager control, because it has no user interface (UI).



    GetConsumerConnectionPoints(WebPart)
    GetConsumerConnectionPoints(WebPart)
    GetConsumerConnectionPoints(WebPart)
    GetConsumerConnectionPoints(WebPart)

    Retrieves the collection of ConsumerConnectionPoint objects that can act as connection points from a server control that is acting as a consumer within a Web Parts connection.



    GetCurrentWebPartManager(Page)
    GetCurrentWebPartManager(Page)
    GetCurrentWebPartManager(Page)
    GetCurrentWebPartManager(Page)

    Retrieves a reference to the current instance of the WebPartManager control on a page.



    GetDesignModeState()
    GetDesignModeState()
    GetDesignModeState()
    GetDesignModeState()

    Gets design-time data for a control.

    (Inherited from Control)



    GetDisplayTitle(WebPart)
    GetDisplayTitle(WebPart)
    GetDisplayTitle(WebPart)
    GetDisplayTitle(WebPart)

    Gets a string containing the value for the DisplayTitle property of a WebPart control.



    GetExportUrl(WebPart)
    GetExportUrl(WebPart)
    GetExportUrl(WebPart)
    GetExportUrl(WebPart)

    Gets the relative virtual path and the query string that are part of the request when a user attempts to export a WebPart control.



    GetGenericWebPart(Control)
    GetGenericWebPart(Control)
    GetGenericWebPart(Control)
    GetGenericWebPart(Control)

    Gets a reference to the instance of the GenericWebPart control that contains a server control.



    GetHashCode()
    GetHashCode()
    GetHashCode()
    GetHashCode()

    Serves as the default hash function.

    (Inherited from Object)



    GetProviderConnectionPoints(WebPart)
    GetProviderConnectionPoints(WebPart)
    GetProviderConnectionPoints(WebPart)
    GetProviderConnectionPoints(WebPart)

    Retrieves the collection of ProviderConnectionPoint objects that can act as connection points from a server control that is acting as a provider within a Web Parts connection.



    GetRouteUrl(Object)
    GetRouteUrl(Object)
    GetRouteUrl(Object)
    GetRouteUrl(Object)

    Gets the URL that corresponds to a set of route parameters.

    (Inherited from Control)



    GetRouteUrl(RouteValueDictionary)
    GetRouteUrl(RouteValueDictionary)
    GetRouteUrl(RouteValueDictionary)
    GetRouteUrl(RouteValueDictionary)

    Gets the URL that corresponds to a set of route parameters.

    (Inherited from Control)



    GetRouteUrl(String, Object)
    GetRouteUrl(String, Object)
    GetRouteUrl(String, Object)
    GetRouteUrl(String, Object)

    Gets the URL that corresponds to a set of route parameters and a route name.

    (Inherited from Control)



    GetRouteUrl(String, RouteValueDictionary)
    GetRouteUrl(String, RouteValueDictionary)
    GetRouteUrl(String, RouteValueDictionary)
    GetRouteUrl(String, RouteValueDictionary)

    Gets the URL that corresponds to a set of route parameters and a route name.

    (Inherited from Control)



    GetType()
    GetType()
    GetType()
    GetType()

    Gets the Type of the current instance.

    (Inherited from Object)



    GetUniqueIDRelativeTo(Control)
    GetUniqueIDRelativeTo(Control)
    GetUniqueIDRelativeTo(Control)
    GetUniqueIDRelativeTo(Control)

    Returns the prefixed portion of the UniqueID property of the specified control.

    (Inherited from Control)



    HasControls()
    HasControls()
    HasControls()
    HasControls()

    Determines if the server control contains any child controls.

    (Inherited from Control)



    HasEvents()
    HasEvents()
    HasEvents()
    HasEvents()

    Returns a value indicating whether events are registered for the control or any child controls.

    (Inherited from Control)



    ImportWebPart(XmlReader, String)
    ImportWebPart(XmlReader, String)
    ImportWebPart(XmlReader, String)
    ImportWebPart(XmlReader, String)

    Imports an XML description file that contains state and property data for a WebPart control, and applies the data to the control.



    IsAuthorized(Type, String, String, Boolean)
    IsAuthorized(Type, String, String, Boolean)
    IsAuthorized(Type, String, String, Boolean)
    IsAuthorized(Type, String, String, Boolean)

    Carries out the final steps in determining whether a control is authorized to be added to a page.



    IsAuthorized(WebPart)
    IsAuthorized(WebPart)
    IsAuthorized(WebPart)
    IsAuthorized(WebPart)

    Carries out the initial steps in determining whether a control is authorized to be added to a page.



    IsLiteralContent()
    IsLiteralContent()
    IsLiteralContent()
    IsLiteralContent()

    Determines if the server control holds only literal content.

    (Inherited from Control)



    LoadControlState(Object)
    LoadControlState(Object)
    LoadControlState(Object)
    LoadControlState(Object)

    Loads control state data that was saved from a previous page request, and needs to be restored on a subsequent request.



    LoadCustomPersonalizationState(PersonalizationDictionary)
    LoadCustomPersonalizationState(PersonalizationDictionary)
    LoadCustomPersonalizationState(PersonalizationDictionary)
    LoadCustomPersonalizationState(PersonalizationDictionary)

    Stores the custom personalization data that has been passed to the WebPartManager control by the personalization objects to be used later during the initialization process.



    LoadViewState(Object)
    LoadViewState(Object)
    LoadViewState(Object)
    LoadViewState(Object)

    Restores view-state information from a previous page request that was saved by the SaveViewState() method.

    (Inherited from Control)



    MapPathSecure(String)
    MapPathSecure(String)
    MapPathSecure(String)
    MapPathSecure(String)

    Retrieves the physical path that a virtual path, either absolute or relative, maps to.

    (Inherited from Control)



    MemberwiseClone()
    MemberwiseClone()
    MemberwiseClone()
    MemberwiseClone()

    Creates a shallow copy of the current Object.

    (Inherited from Object)



    MoveWebPart(WebPart, WebPartZoneBase, Int32)
    MoveWebPart(WebPart, WebPartZoneBase, Int32)
    MoveWebPart(WebPart, WebPartZoneBase, Int32)
    MoveWebPart(WebPart, WebPartZoneBase, Int32)

    Moves a WebPart or server control from one WebPartZoneBase zone to another, or to a new position within the same zone.



    OnAuthorizeWebPart(WebPartAuthorizationEventArgs)
    OnAuthorizeWebPart(WebPartAuthorizationEventArgs)
    OnAuthorizeWebPart(WebPartAuthorizationEventArgs)
    OnAuthorizeWebPart(WebPartAuthorizationEventArgs)

    Raises the AuthorizeWebPart event and invokes a handler for the event, if one exists.



    OnBubbleEvent(Object, EventArgs)
    OnBubbleEvent(Object, EventArgs)
    OnBubbleEvent(Object, EventArgs)
    OnBubbleEvent(Object, EventArgs)

    Determines whether the event for the server control is passed up the page’s UI server control hierarchy.

    (Inherited from Control)



    OnConnectionsActivated(EventArgs)
    OnConnectionsActivated(EventArgs)
    OnConnectionsActivated(EventArgs)
    OnConnectionsActivated(EventArgs)

    Raises the ConnectionsActivated event to indicate that a page and its controls are loaded, and connections on the page have been activated to begin sharing data.



    OnConnectionsActivating(EventArgs)
    OnConnectionsActivating(EventArgs)
    OnConnectionsActivating(EventArgs)
    OnConnectionsActivating(EventArgs)

    Raises the ConnectionsActivating event to indicate that a page and its controls have loaded, and the process of activating connections can begin.



    OnDataBinding(EventArgs)
    OnDataBinding(EventArgs)
    OnDataBinding(EventArgs)
    OnDataBinding(EventArgs)

    Raises the DataBinding event.

    (Inherited from Control)



    OnDisplayModeChanged(WebPartDisplayModeEventArgs)
    OnDisplayModeChanged(WebPartDisplayModeEventArgs)
    OnDisplayModeChanged(WebPartDisplayModeEventArgs)
    OnDisplayModeChanged(WebPartDisplayModeEventArgs)

    Raises the DisplayModeChanged event to indicate that the WebPartManager control has completed the process of switching from one display mode to another on a Web page.



    OnDisplayModeChanging(WebPartDisplayModeCancelEventArgs)
    OnDisplayModeChanging(WebPartDisplayModeCancelEventArgs)
    OnDisplayModeChanging(WebPartDisplayModeCancelEventArgs)
    OnDisplayModeChanging(WebPartDisplayModeCancelEventArgs)

    Raises the DisplayModeChanging event to indicate that the WebPartManager control is in the process of switching from one display mode to another on a Web page.



    OnInit(EventArgs)
    OnInit(EventArgs)
    OnInit(EventArgs)
    OnInit(EventArgs)

    Raises the Init event, which is the first event in the WebPartManager control life cycle.



    OnLoad(EventArgs)
    OnLoad(EventArgs)
    OnLoad(EventArgs)
    OnLoad(EventArgs)

    Raises the Load event.

    (Inherited from Control)



    OnPreRender(EventArgs)
    OnPreRender(EventArgs)
    OnPreRender(EventArgs)
    OnPreRender(EventArgs)

    Raises the PreRender event, which occurs just before a WebPartManager control is rendered on a Web page.



    OnSelectedWebPartChanged(WebPartEventArgs)
    OnSelectedWebPartChanged(WebPartEventArgs)
    OnSelectedWebPartChanged(WebPartEventArgs)
    OnSelectedWebPartChanged(WebPartEventArgs)

    Raises the SelectedWebPartChanged event, which occurs after a WebPart control has either been newly selected or had its selection cleared.



    OnSelectedWebPartChanging(WebPartCancelEventArgs)
    OnSelectedWebPartChanging(WebPartCancelEventArgs)
    OnSelectedWebPartChanging(WebPartCancelEventArgs)
    OnSelectedWebPartChanging(WebPartCancelEventArgs)

    Raises the SelectedWebPartChanging event, which occurs during the process of changing which WebPart control is currently selected.



    OnUnload(EventArgs)
    OnUnload(EventArgs)
    OnUnload(EventArgs)
    OnUnload(EventArgs)

    Raises the base Unload event and removes the WebPartManager instance from a Web page.



    OnWebPartAdded(WebPartEventArgs)
    OnWebPartAdded(WebPartEventArgs)
    OnWebPartAdded(WebPartEventArgs)
    OnWebPartAdded(WebPartEventArgs)

    Raises the WebPartAdded event, which occurs after a WebPart control has been added to a page.



    OnWebPartAdding(WebPartAddingEventArgs)
    OnWebPartAdding(WebPartAddingEventArgs)
    OnWebPartAdding(WebPartAddingEventArgs)
    OnWebPartAdding(WebPartAddingEventArgs)

    Raises the WebPartAdding event, which occurs during the process of adding a WebPart control (or a server or user control) to a WebPartZoneBase zone.



    OnWebPartClosed(WebPartEventArgs)
    OnWebPartClosed(WebPartEventArgs)
    OnWebPartClosed(WebPartEventArgs)
    OnWebPartClosed(WebPartEventArgs)

    Raises the WebPartClosed event to signal that a control has been removed from a page.



    OnWebPartClosing(WebPartCancelEventArgs)
    OnWebPartClosing(WebPartCancelEventArgs)
    OnWebPartClosing(WebPartCancelEventArgs)
    OnWebPartClosing(WebPartCancelEventArgs)

    Raises the WebPartClosing event, which occurs during the process of a WebPart or server control being removed from a page.



    OnWebPartDeleted(WebPartEventArgs)
    OnWebPartDeleted(WebPartEventArgs)
    OnWebPartDeleted(WebPartEventArgs)
    OnWebPartDeleted(WebPartEventArgs)

    Raises the WebPartDeleted event, which occurs after a WebPart control has been permanently deleted from a page.



    OnWebPartDeleting(WebPartCancelEventArgs)
    OnWebPartDeleting(WebPartCancelEventArgs)
    OnWebPartDeleting(WebPartCancelEventArgs)
    OnWebPartDeleting(WebPartCancelEventArgs)

    Raises the WebPartDeleting event, which indicates that a dynamic WebPart control (or server or user control that is contained in a WebPartZoneBase zone) is in the process of being deleted.



    OnWebPartMoved(WebPartEventArgs)
    OnWebPartMoved(WebPartEventArgs)
    OnWebPartMoved(WebPartEventArgs)
    OnWebPartMoved(WebPartEventArgs)

    Raises the WebPartMoved event, which occurs after a WebPart control has been moved to a different location on a page.



    OnWebPartMoving(WebPartMovingEventArgs)
    OnWebPartMoving(WebPartMovingEventArgs)
    OnWebPartMoving(WebPartMovingEventArgs)
    OnWebPartMoving(WebPartMovingEventArgs)

    Raises the WebPartMoving event, which indicates that a WebPart or server or user control in a WebPartZoneBase zone is in the process of being moved.



    OnWebPartsConnected(WebPartConnectionsEventArgs)
    OnWebPartsConnected(WebPartConnectionsEventArgs)
    OnWebPartsConnected(WebPartConnectionsEventArgs)
    OnWebPartsConnected(WebPartConnectionsEventArgs)

    Raises the WebPartsConnected event, which occurs after a connection has been established between WebPart controls.



    OnWebPartsConnecting(WebPartConnectionsCancelEventArgs)
    OnWebPartsConnecting(WebPartConnectionsCancelEventArgs)
    OnWebPartsConnecting(WebPartConnectionsCancelEventArgs)
    OnWebPartsConnecting(WebPartConnectionsCancelEventArgs)

    Raises the WebPartsConnecting event, which occurs during the process of establishing a connection between two WebPart or server or user controls contained in a WebPartZoneBase zone.



    OnWebPartsDisconnected(WebPartConnectionsEventArgs)
    OnWebPartsDisconnected(WebPartConnectionsEventArgs)
    OnWebPartsDisconnected(WebPartConnectionsEventArgs)
    OnWebPartsDisconnected(WebPartConnectionsEventArgs)

    Raises the WebPartsDisconnected event, which occurs after a connection between WebPart controls has ended.



    OnWebPartsDisconnecting(WebPartConnectionsCancelEventArgs)
    OnWebPartsDisconnecting(WebPartConnectionsCancelEventArgs)
    OnWebPartsDisconnecting(WebPartConnectionsCancelEventArgs)
    OnWebPartsDisconnecting(WebPartConnectionsCancelEventArgs)

    Raises the WebPartsDisconnecting event, which indicates that two WebPart or server or user controls in a WebPartZoneBase zone are in the process of ending a connection.



    OpenFile(String)
    OpenFile(String)
    OpenFile(String)
    OpenFile(String)

    Gets a Stream used to read a file.

    (Inherited from Control)



    RaiseBubbleEvent(Object, EventArgs)
    RaiseBubbleEvent(Object, EventArgs)
    RaiseBubbleEvent(Object, EventArgs)
    RaiseBubbleEvent(Object, EventArgs)

    Assigns any sources of the event and its information to the control’s parent.

    (Inherited from Control)



    RegisterClientScript()
    RegisterClientScript()
    RegisterClientScript()
    RegisterClientScript()

    Enables the WebPartManager control to emit client-side script that is used for various personalization features, such as dragging WebPart controls in a Web page.



    RemovedControl(Control)
    RemovedControl(Control)
    RemovedControl(Control)
    RemovedControl(Control)

    Called after a child control is removed from the Controls collection of the Control object.

    (Inherited from Control)



    Render(HtmlTextWriter)
    Render(HtmlTextWriter)
    Render(HtmlTextWriter)
    Render(HtmlTextWriter)

    Overridden to prevent the WebPartManager control from rendering any content.



    RenderChildren(HtmlTextWriter)
    RenderChildren(HtmlTextWriter)
    RenderChildren(HtmlTextWriter)
    RenderChildren(HtmlTextWriter)

    Outputs the content of a server control’s children to a provided HtmlTextWriter object, which writes the content to be rendered on the client.

    (Inherited from Control)



    RenderControl(HtmlTextWriter)
    RenderControl(HtmlTextWriter)
    RenderControl(HtmlTextWriter)
    RenderControl(HtmlTextWriter)

    Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled.

    (Inherited from Control)



    RenderControl(HtmlTextWriter, ControlAdapter)
    RenderControl(HtmlTextWriter, ControlAdapter)
    RenderControl(HtmlTextWriter, ControlAdapter)
    RenderControl(HtmlTextWriter, ControlAdapter)

    Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object.

    (Inherited from Control)



    ResolveAdapter()
    ResolveAdapter()
    ResolveAdapter()
    ResolveAdapter()

    Gets the control adapter responsible for rendering the specified control.

    (Inherited from Control)



    ResolveClientUrl(String)
    ResolveClientUrl(String)
    ResolveClientUrl(String)
    ResolveClientUrl(String)

    Gets a URL that can be used by the browser.

    (Inherited from Control)



    ResolveUrl(String)
    ResolveUrl(String)
    ResolveUrl(String)
    ResolveUrl(String)

    Converts a URL into one that is usable on the requesting client.

    (Inherited from Control)



    SaveControlState()
    SaveControlState()
    SaveControlState()
    SaveControlState()

    Saves state data for the WebPartManager control so the data can be restored on future request to the Web page that contains the control.



    SaveCustomPersonalizationState(PersonalizationDictionary)
    SaveCustomPersonalizationState(PersonalizationDictionary)
    SaveCustomPersonalizationState(PersonalizationDictionary)
    SaveCustomPersonalizationState(PersonalizationDictionary)

    Saves custom personalization state data maintained by the WebPartManager control, so that this data can be reloaded whenever the page is reloaded.



    SaveViewState()
    SaveViewState()
    SaveViewState()
    SaveViewState()

    Saves any server control view-state changes that have occurred since the time the page was posted back to the server.

    (Inherited from Control)



    SetDesignModeState(IDictionary)
    SetDesignModeState(IDictionary)
    SetDesignModeState(IDictionary)
    SetDesignModeState(IDictionary)

    Sets design-time data for a control.

    (Inherited from Control)



    SetPersonalizationDirty()
    SetPersonalizationDirty()
    SetPersonalizationDirty()
    SetPersonalizationDirty()

    Sets a flag indicating that custom personalization data for the WebPartManager control has changed.



    SetRenderMethodDelegate(RenderMethod)
    SetRenderMethodDelegate(RenderMethod)
    SetRenderMethodDelegate(RenderMethod)
    SetRenderMethodDelegate(RenderMethod)

    Assigns an event handler delegate to render the server control and its content into its parent control.

    (Inherited from Control)



    SetSelectedWebPart(WebPart)
    SetSelectedWebPart(WebPart)
    SetSelectedWebPart(WebPart)
    SetSelectedWebPart(WebPart)

    Sets the SelectedWebPart property value equal to the currently selected WebPart or server control.



    SetTraceData(Object, Object)
    SetTraceData(Object, Object)
    SetTraceData(Object, Object)
    SetTraceData(Object, Object)

    Sets trace data for design-time tracing of rendering data, using the trace data key and the trace data value.

    (Inherited from Control)



    SetTraceData(Object, Object, Object)
    SetTraceData(Object, Object, Object)
    SetTraceData(Object, Object, Object)
    SetTraceData(Object, Object, Object)

    Sets trace data for design-time tracing of rendering data, using the traced object, the trace data key, and the trace data value.

    (Inherited from Control)



    ToString()
    ToString()
    ToString()
    ToString()

    Returns a string that represents the current object.

    (Inherited from Object)



    TrackViewState()
    TrackViewState()
    TrackViewState()
    TrackViewState()

    Applies personalization state data to the WebPartManager control, and calls the base method to enable tracking changes to the view-state data for the control.



    FindDataSourceControl(Control)
    FindDataSourceControl(Control)
    FindDataSourceControl(Control)
    FindDataSourceControl(Control)

    Returns the data source that is associated with the data control for the specified control.



    FindFieldTemplate(Control, String)
    FindFieldTemplate(Control, String)
    FindFieldTemplate(Control, String)
    FindFieldTemplate(Control, String)

    Returns the field template for the specified column in the specified control’s naming container.



    FindMetaTable(Control)
    FindMetaTable(Control)
    FindMetaTable(Control)
    FindMetaTable(Control)

    Returns the metatable object for the containing data control.



    GetDefaultValues(INamingContainer)
    GetDefaultValues(INamingContainer)
    GetDefaultValues(INamingContainer)
    GetDefaultValues(INamingContainer)

    Gets the collection of the default values for the specified data control.



    GetMetaTable(INamingContainer)
    GetMetaTable(INamingContainer)
    GetMetaTable(INamingContainer)
    GetMetaTable(INamingContainer)

    Gets the table metadata for the specified data control.



    SetMetaTable(INamingContainer, MetaTable)
    SetMetaTable(INamingContainer, MetaTable)
    SetMetaTable(INamingContainer, MetaTable)
    SetMetaTable(INamingContainer, MetaTable)

    Sets the table metadata for the specified data control.



    SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>)
    SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>)
    SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>)
    SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>)

    Sets the table metadata and default value mapping for the specified data control.



    SetMetaTable(INamingContainer, MetaTable, Object)
    SetMetaTable(INamingContainer, MetaTable, Object)
    SetMetaTable(INamingContainer, MetaTable, Object)
    SetMetaTable(INamingContainer, MetaTable, Object)

    Sets the table metadata and default value mapping for the specified data control.



    TryGetMetaTable(INamingContainer, MetaTable)
    TryGetMetaTable(INamingContainer, MetaTable)
    TryGetMetaTable(INamingContainer, MetaTable)
    TryGetMetaTable(INamingContainer, MetaTable)

    Determines whether table metadata is available.



    EnableDynamicData(INamingContainer, Type)
    EnableDynamicData(INamingContainer, Type)
    EnableDynamicData(INamingContainer, Type)
    EnableDynamicData(INamingContainer, Type)

    Enables Dynamic Data behavior for the specified data control.



    EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>)
    EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>)
    EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>)
    EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>)

    Enables Dynamic Data behavior for the specified data control.



    EnableDynamicData(INamingContainer, Type, Object)
    EnableDynamicData(INamingContainer, Type, Object)
    EnableDynamicData(INamingContainer, Type, Object)
    EnableDynamicData(INamingContainer, Type, Object)

    Enables Dynamic Data behavior for the specified data control.




    source_link
    https://www.asp.net