|
Server API Reference |
Top Previous Next |
|
As an alternative to the implementation of DbNetFile as a client-object it can also be implemented as a server-control which has the advantage of offering intellisense support in Visual Studio. The server-control acts a wrapper for the client-control and generates the required JavaScript to implement the control. <%@ Register TagPrefix="DNL" Namespace="DbNetLink.DbNetSuite.UI" Assembly="DbNetLink.DbNetSuite" %> ... <DNL:DbNetFile id="DbNetFile1" RootFolder="~/samples/dbnetfile/files" Search="true" runat="server"> <FileColumns> <DNL:FileColumn ColumnType="Icon" Label=""/> <DNL:FileColumn ColumnType="Name" Label="Name" Selectable="true"/> <DNL:FileColumn ColumnType="Folder" Label="Folder"/> <DNL:FileColumn ColumnType="DateCreated" Label="Created" Format="MMM yyyy"/> <DNL:FileColumn ColumnType="Size" Label="Size"/> <DNL:FileColumn ColumnType="DateLastModified" Label="Last Modified" Format="g"/> <DNL:FileColumn ColumnType="DateLastAccessed" Label="Last Accessed" Format="dddd"/> <DNL:FileColumn ColumnType="Thumbnail" Label="Thumb"/> </FileColumns> </DNL:DbNetFile> The simplest file control can be created by specifying just the RootFolder property The RootFolder property specifies the name of the top level folder from which the user can navigate. The RootFolder can be specified either as a virtual or physical path. The RootFolderAlias property allows you to specify a user friendly name for the RootFolder.
<DNL:DbNetFile
...
RootFolder = "~/samples/dbnetfile/files/images"
RootFolderAlias = "Bee-Eater Pictures" >
</DNL:DbNetFile>
The Columns collection allows you to specify the information you require for the listed folder or file.
<DNL:DbNetFile
... >
Controls the ability to delete folders when the deleteRow toolbar property is enabled if set to true the folder in the first row will be automatically selected after the rows have loaded. This property specifies the mechanism that DbNetFile uses to browse the available folders and files. You can choose from FileSystem, IndexingServer or WindowsSearch. <DNL:DbNetFile ... BrowseMode="WindowsSearch" > </DNL:DbNetFile> This property will cause DbNetFile to create the specified RootFolder if it does not exist. <DNL:DbNetFile ... RootFolderAlias="Today" CreateFolder="true"> </DNL:DbNetFile> The CustomMimeTypes collection allows you to specify custom MIME types for particular file extensions. For example if you wanted to present CSS files as plain text then you can create a MIME type of "text/plain" for the file extension CSS. <DNL:DbNetFile id="DbNetFile1" RootFolder="~/css" runat="server" > <CustomMimeTypes> <DNL:MimeType Extension="css" ContentType="text/plain"> </CustomMimeTypes> </DNL:DbNetFile> Sets the display style to either Grid or Tree <DNL:DbNetFile ... DisplayStyle="Tree" > </DNL:DbNetFile> The FileClientEvents collection allows you to specify handlers for any of the client-side events that are available. <DNL:DbNetFile id="DbNetFile1" RootFolder="~/samples/dbnetfile/files/images" Search="true" DeleteRow = "true" Upload="true" UploadFileTypes = "jpg,png,gif" Runat="server" > <FileColumns> <DNL:FileColumn ColumnType="Icon" Label=""/> <DNL:FileColumn ColumnType="Name" Label="Name" Selectable="true"/> <DNL:FileColumn ColumnType="Folder" Label="Folder"/> <DNL:FileColumn ColumnType="Size"/> <DNL:FileColumn ColumnType="Thumbnail" Label="Thumb"/> </FileColumns> <FileClientEvents> <DNL:FileClientEvent EventName="onBeforeFileSelected" Handler="checkFileAccess"/> </FileClientEvents> </DNL:DbNetFile> Sets the default display action for a selected file to either Download (document is downloaded), Preview (document is displayed in Preview dialog), Display (document is displayed in a new browser window) or None (no action) Specifies the location of the element that displays the current folder path information <DNL:DbNetFile ... FolderPathLocation="Top"> </DNL:DbNetFile>
Controls the appearance of the Heading row <DNL:DbNetFile ... HeaderRow="False"> </DNL:DbNetFile>
Specifies the height of a Tree style control <DNL:DbNetFile ... DisplayStyle="Tree" Height="400px" > </DNL:DbNetFile>
Specifies the name of the IndexingServiceCatalog. Only used if the BrowseMode or SearchMode is set to IndexingService <DNL:DbNetFile ... BrowseMode="IndexingServer" IndexingServiceCatalog="WebCatalog" > </DNL:DbNetFile>
The LinkedControls collection specifies a child DbNetFile control. The LinkedControl element requires that the LinkedControlID property specifies the ID of the child control/ <DNL:DbNetFile ... BrowseMode="IndexingServer" IndexingServiceCatalog="WebCatalog" > </DNL:DbNetFile> This property sets the maximum number of files that will be matched when searching for files. The default is 100. <DNL:DbNetFile ... MaxSearchMatches="50" > </DNL:DbNetFile> Specifies the column by which the files should be initially sorted Specifies the number of rows displayed per page <DNL:DbNetFile ... PageSize="20" > </DNL:DbNetFile> Specifies the initial height of the document preview dialog Specifies the initial width of the document preview dialog <DNL:DbNetFile ... PreviewDialogWidth="400px" PreviewDialogHeight="400px" > </DNL:DbNetFile> This property specifies the mechanism that DbNetFile uses to search the available folders and files. You can choose from FileSystem, IndexingService or WindowsSearch. <DNL:DbNetFile ... SearchMode="WindowsSearch" > </DNL:DbNetFile> Specifies a comma separated list of file extensions that are selectable. Any files whose extensions are not in the list are displayed but cannot be selected.
Limits selected records to Files, Folders or FoldersAndFiles
Specifies the height of the image thumbnail. The width of the thumbnail is automatically set to keep the image in proportion. <DNL:DbNetFile ... ThumbnailHeight="50px" > </DNL:DbNetFile> Specifies the size of the image thumbnail as a percentage of the original. <DNL:DbNetFile ... ThumbnailPercent="30%" > </DNL:DbNetFile>
Specifies the width of the image thumbnail. The height of the thumbnail is automatically set to keep the image in proportion. <DNL:DbNetFile ... ThumbnailWidth="50px" > </DNL:DbNetFile>
Sets the location/visibility of the toolbar. Values are Top (toolbar displayed above grid), Bottom (toolbar displayed below grid) or Hidden (toolbar is hidden) A comma separated list of file extensions that can be uploaded. <DNL:DbNetFile ... Upload="True" UploadFileTypes="jpg, png, bmp, gif, doc, docx, txt" > </DNL:DbNetFile>
The maximum size in kilobytes of files that can be uploaded. <DNL:DbNetFile ... Upload="True" UploadMaxFileSizeKb="200" > </DNL:DbNetFile>
Enables the overwriting of files on the server by uploaded files with the same name. <DNL:DbNetFile ... Upload="True" UploadAllowOverwrite="True" > </DNL:DbNetFile>
Specifies a comma separated list of file extensions that are visible. Any files whose extensions are not in the list are not displayed. <DNL:DbNetFile ... Upload="True" VisibleFileTypes="jpg, png, bmp, gif, doc, docx, txt" > </DNL:DbNetFile> Specifies the width of a Tree style control <DNL:DbNetFile ... DisplayStyle="Tree" Width="400px" > </DNL:DbNetFile> Specifies the connection string used to connect to Windows Search engine. Defaults to: Provider=Search.CollatorDSO;Extended Properties='Application=Windows' The following properties control the buttons and information displayed in the toolbar Controls the appearance of the button to delete the selected file or folder Controls the appearance of the button to create a new folder. Controls the appearance of the button to open the search dialog Controls the appearance of the button to open the file upload dialog
|