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>

Basic Properties

The simplest file control can be created by specifying just the RootFolder property

RootFolder

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.

RootFolderAlias

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> 

Run Sample

FileColumns

The Columns collection allows you to specify the information you require for the listed folder or file.

<DNL:DbNetFile    
		... >   
         
           
           
           
       
</DNL:DbNetFile> 

Run Sample

Additional Properties

AllowFolderDeletion

Controls the ability to delete folders when the deleteRow toolbar property is enabled

AutoSelectFolder

if set to true the folder in the first row will be automatically selected after the rows have loaded.

Run Sample

BrowseMode

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>

Run Sample

CreateFolder

This property will cause DbNetFile to create the specified RootFolder if it does not exist.

	<DNL:DbNetFile 
		...
		RootFolderAlias="Today"
		CreateFolder="true">
	</DNL:DbNetFile>
	
  

Run Sample

CustomMimeTypes

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>

Run Sample

DisplayStyle

Sets the display style to either Grid or Tree

<DNL:DbNetFile    
	...   
	DisplayStyle="Tree" >   
</DNL:DbNetFile>  

Run Sample

FileClientEvents

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>

Run Sample

FileSelectionAction

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)

Run Sample

FolderPathLocation

Specifies the location of the element that displays the current folder path information

<DNL:DbNetFile    
	...
	FolderPathLocation="Top">   
</DNL:DbNetFile>

 

Run Sample

HeaderRow

Controls the appearance of the Heading row

<DNL:DbNetFile    
	...
	HeaderRow="False">   
</DNL:DbNetFile>

 

Run Sample

Height

Specifies the height of a Tree style control

<DNL:DbNetFile   
	...     
	DisplayStyle="Tree"        
	Height="400px" >   
</DNL:DbNetFile>  

 

Run Sample

IndexingServiceCatalog

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>

 

LinkedControls

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>

Run Sample

MaxSearchMatches

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>  

OrderBy

Specifies the column by which the files should be initially sorted

Run Sample

PageSize

Specifies the number of rows displayed per page

<DNL:DbNetFile 
	...       
	PageSize="20" >   
</DNL:DbNetFile>  

PreviewDialogHeight

Specifies the initial height of the document preview dialog

PreviewDialogWidth

Specifies the initial width of the document preview dialog

<DNL:DbNetFile 
	...       
	PreviewDialogWidth="400px"
	PreviewDialogHeight="400px" >   
</DNL:DbNetFile>  

SearchMode

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>

SelectableFileTypes

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.