Gallery can work with files (when every element of this gallery is a file in given folder) and with MS SQL or MS Access databases.
Work with file gallery
Set the property GalleryProviderType equal File.
Set working folder for Media Gallery by defining ContentFolderUrl property.
This is a folder in which you will place images for your users content. Create a folder in your application (for most applications, this is your web server's root folder, or the folder where your Visual Studio project file is located). The folder can be named something like "/uploads/", "/images" or "/UserImages".
 |
Make sure that the MACHINE/ASPNET user has Read + Write permissions on this folder and its contents. |
Work with MS SQL gallery
Create new database MS SQL or connect to the existing one. The component uses for its work several fields which must have defined type for the correct work of the gallery.
Structure of the table in the base is shown in the picture:
Set the following data types for the fields:
Set the property GalleryProviderType equal SQL.
Set the values of properties TableName, KeyField, DescriptionField, MetadataField, MediaField according to names of tables and fields in the base.
Select needed base from the list of databases in the field ConnectionString and the string of connecting to database will be created automatically.
Work with the database MS SQL will be possible when all these actions are performed.
Work with MS Access gallery
Like for MS SQL galleries the component uses for its work several fields which must have the determined type for the correct work.
Structure of the table in the base is shown in the picture.
Create the fields in the table with the following data types:
- counter - unique identifier of the element in the base a key field;
- MEMO field- field for keeping file name;
- MEMO field- field for keeping system information;
- MEMO field a field for keeping binary data of the element.
Set the property GalleryProviderType equal Access.
Set the values of properties TableName, KeyField, DescriptionField, MetadataField, MediaField according to the names of tables in the base.

Select needed base from the list of databases in the field ConnectionString and the string of connecting to database will be created automatically.
Work with the database MS Access will be possible when all these actions are performed.
 |
If you get the error message "Operation must use an updatable query" give the user IUSR_MACHINENAME permissions for changing and writing App_Data directory. |
After pressing an Browser button gallery window will open. It contains files of the type which was set in control properties. For example: if there was set GalleryContentType to Image so there would be only pictures in the gallery. But if there was used Custom type there would be shown files with the mask GalleryFileMask.
After pressing an OK button in the gallery the path to the selected file will be shown in input field of control.
For file gallery - relative path to the file:
For database gallery - item identifier in the database.
HowTo: How to create custom gallery
Controls: GalleryBox | Editor | Media Gallery
© 2002-2007 Astron Digital. All Rights Reserved.