Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

ListAdministrationSelector class

Allows a user to select a list from a given site collection and Web site.

System.Object
  System.Web.UI.Control
    System.Web.UI.WebControls.WebControl
      Microsoft.SharePoint.WebControls.ContextSelector<SPList>
        Microsoft.SharePoint.WebControls.ListAdministrationSelector

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class ListAdministrationSelector : ContextSelector<SPList>

ListAdministrationSelector requires that SiteSelector and WebSelector are not a null reference (Nothing in Visual Basic).

The following example shows how to create the .aspx file for a Web page that uses the list administration selector control.

          <table>
            <tr>
              <td align="right">
            <SharePoint:SiteAdministrationSelector
                id="SiteSelector"
                AllowAdministrationWebApplication="false"
                OnContextChange="OnSiteContextChange"
                runat="server" />
              </td>
            </tr>
            <tr>
              <td align="right">
            <SharePoint:WebAdministrationSelector
                id="WebSelector"
                OnContextChange="OnWebContextChange"
                runat="server" />
              </td>
            </tr>
            <tr>
              <td align="right">
                <SharePoint:ListAdministrationSelector
                    id="ListSelector"
                    OnContextChange="OnListContextChange"
                    runat="server" />
              </td>
            </tr>
          </table>

The following example shows how to handle the events for the list administration control used on the Web page in the previous example.

        protected void OnSiteContextChange(object sender, EventArgs e)
        {
            SiteAdministrationSelector siteSelect =
                (SiteAdministrationSelector)sender;

            if (String.IsNullOrEmpty(siteSelect.CurrentId))
            {
                WebSelector.Enabled = false;
            }
            else
            {
                WebSelector.Enabled = true;
            }
        }

        protected void OnWebContextChange(object sender, EventArgs e)
        {
            WebAdministrationSelector webSelect =
                (WebAdministrationSelector)sender;

            if (String.IsNullOrEmpty(webSelect.CurrentId))
            {
                ListSelector.Enabled = false;
            }
            else
            {
                ListSelector.Enabled = true;
            }
        }

        protected void OnListContextChange(object sender, EventArgs e)
        {
        }

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.