SP.List Class

SharePoint 2010

Last modified: May 26, 2011

Applies to: SharePoint Foundation 2010

Represents a list on a SharePoint Web site.


The BrowserFileHandling, DataSource, EffectiveBasePermissions, HasUniqueRoleAssignments, IsAttachmentLibrary, OnQuickLaunch, SchemaXml, ValidationFormula and ValidationMessage properties are not included in the default scalar property set for this type.

The following example creates an input button on an application page that creates a new discussion board list on the current web site.

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<script type="text/ecmascript" language="ecmascript">

    var list;
    function runCode() {
        var clientContext = new SP.ClientContext.get_current();

        if (clientContext != undefined && clientContext != null) {
            var web = clientContext.get_web();

            // Specify the properties of the new list.
            var listCreationInfo = new SP.ListCreationInformation();
            listCreationInfo.set_title('New Discussion Board');

            this.list = web.get_lists().add(listCreationInfo);

            clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));

    function onQuerySucceeded() {
        var result = ' Added Discussion Board: ' + this.list.get_title();

    function onQueryFailed(sender, args) {
        alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());


    <input id="Button1" type="button" value="Run Code" onclick="runCode()" />