Skip to main content
All docs
V25.1
  • Tab

    UploadControlSharePointSettings Class

    Contains settings that allow you to connect the Upload Control to SharePoint.

    Namespace: DevExpress.Web

    Assembly: DevExpress.Web.v25.1.dll

    NuGet Package: DevExpress.Web

    Declaration

    public class UploadControlSharePointSettings :
        UploadControlUploadStorageSettingsBase

    The following members return UploadControlSharePointSettings objects:

    Library Related API Members
    ASP.NET Web Forms Controls ASPxUploadControl.SharePointSettings
    ASP.NET MVC Extensions UploadControlBinderSettings.SharePointSettings
    UploadControlSettings.SharePointSettings

    Remarks

    Follow the steps below to connect the Upload Control to SharePoint:

    1. Call the RegisterOneDrive method in the Global.asax file.
    2. Set the Upload Control’s UploadStorage property to SharePoint.
    3. Assign a SharePoint account’s name to the SharePointSettings.AccountName property.

    The following example demonstrates how to connect the Upload Control to SharePoint:

    void Application_Start(object sender, EventArgs e) {
       DevExpress.Web.AccountManager.RegisterOneDrive("YourOneDriveAccount", "YourClientId", "YourClientSecret");
    }
    
    <dx:ASPxUploadControl ID="UploadControl" runat="server" UploadStorage="SharePoint" ShowUploadButton="True" >
        <SharePointSettings AccountName="YourOneDriveAccount" 
                            TokenEndpoint="YourTokenEndpoint" 
                            RedirectUri="YourRedirectUri"
                            SiteName="YourSiteName" 
                            SiteHostName="YourSiteHostName"/>
    </dx:ASPxUploadControl>
    

    Once the Upload Control uploads a file to cloud storage, you can use the key name of this file to access it. To obtain a file key name, use the FileNameInStorage property of an UploadedFile object.

    See Also