Click or drag to resize

Using FileUltimate in an ASP.NET WebForms project

To use FileUltimate in an ASP.NET WebForms Project, do the following in Visual Studio:

  1. Make sure you have added references to FileUltimate assemblies as described here.

  2. Set FileUltimate's global configuration. For example, you may want to set the license key. Insert some of the following lines (if overriding a default value is required) into the Application_Start method of your Global.asax.cs:

    protected void Application_Start(object sender, EventArgs e)
        //Set this property only if you have a valid license key, otherwise do not 
        //set it so FileUltimate runs in trial mode.  
        FileUltimateConfiguration.Current.LicenseKey = "QQJDJLJP34...";
    Tip Tip

    Alternatively you can specify the configuration in <appSettings> tag of your Web.config.

      <add key="FileUltimate:LicenseKey" value="QQJDJLJP34..." />

    As you would notice, FileUltimate: prefix maps to FileUltimateConfiguration.Current and FileUltimateWeb: prefix maps to FileUltimateWebConfiguration.Current.

  3. Create a new page (eg. Default.aspx) and insert these lines (after Page directive at the top):

    <%@ Register TagPrefix="GleamTech" Namespace="GleamTech.FileUltimate.AspNet.UI" Assembly="GleamTech.FileUltimate" %>
    <%@ Register TagPrefix="GleamTech" Namespace="GleamTech.FileUltimate.AspNet.WebForms" Assembly="GleamTech.FileUltimate" %>
    <!DOCTYPE html>
        <head runat="server">
            <title>File Manager</title>
            <GleamTech:FileManagerControl ID="fileManager" runat="server" 
                <GleamTech:FileManagerRootFolder Name="A Root Folder" Location="~/App_Data/RootFolder1" > 
                    <GleamTech:FileManagerAccessControl Path="\" AllowedPermissions="Full"/> 

    This will render a file manager control in the page which displays one root folder named "A Root Folder" which points to "~/App_Data/RootFolder1" with Full permissions.

    Tip Tip

    Alternatively you can add the namespaces globally in Web.config under <system.web>/<pages>/<controls> tag to avoid adding namespaces in your pages every time:

          <add tagPrefix="GleamTech" namespace="GleamTech.FileUltimate.AspNet.UI" assembly="GleamTech.FileUltimate" />
          <add tagPrefix="GleamTech" namespace="GleamTech.FileUltimate.AspNet.WebForms" assembly="GleamTech.FileUltimate" />