ListAdministrationSelector class
SharePoint Online
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
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)
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)
{
}
Show: