Quickly and easily add a gallery to your ASP.NET application

Gallery Server Pro is an ASP.NET application written in C# for .NET 4.5 and higher. The source code is freely available, and the architecture follows well-known design patterns for easy readability, robustness, and maintainability.

There are two ways to add a gallery to your site:

  • Install as a stand-alone application
  • Add the Gallery Server Pro user control to your existing ASP.NET application

Stand-Alone Application

Screen shot of a stand-alone installation of Gallery Server Pro

A stand-alone installation of Gallery Server Pro

The first approach lets you get started quickly in a simple three-step process:

  1. Extract the files to a directory on your server.
  2. Configure directory as an application in IIS.
  3. Open default.aspx in a browser.

That is it! Your gallery is ready to go. All gallery functionality is contained in a single page at default.aspx, so you may want to edit this page to have the look and feel of your main application. There are a few style sheets that contain colors and other formatting, so you may want to edit these, too.

The advantages of keeping the gallery as a separate application are:

  • Easier upgrading to future versions of Gallery Server Pro
  • Easier maintenance of your existing web site, as the gallery is self-contained

The main disadvantage is that the application runs in its own process, so it is more difficult to share information between the gallery and your main web site. Specifically, you cannot share login status, session state, application state, global variables, or singleton objects. There are ways around these obstacles, but they take some effort. For a truly integrated solution, read on...

Integrate Into Existing ASP.NET Application

Screen shot of Gallery Server Pro integrated into an existing ASP.NET application

An example of Gallery Server Pro integrated into an existing ASP.NET application through the Gallery user control

All functionality is wrapped in a single user control, so adding a gallery to your site is as easy as copying the files and adding the user control to one of your pages. You don't even have to recompile, nor do you need access to the source code for your web site!

Gallery Server Pro can be used in both C# and VB.NET web sites.

Follow a few basic steps to add a gallery to your site:

  1. Copy the Gallery Server Pro files into your web application. Most of them can be placed in a directory of your choosing, but a few need to go in these special directories: App_Data, App_GlobalResources, and bin.
  2. Configure web.config to define a few settings required by Gallery Server Pro.
  3. Choose one of your web pages to host the gallery. For example, create a new gallery.aspx page and have it based on your current master page. Add the following to the top of the page:

<%@ Register TagPrefix="gsp" Namespace="GalleryServerPro.Web" Assembly="GalleryServerPro.Web" %>

At the location in the page where you want the gallery to appear, add:

 <gsp:Gallery ID=="g" runat="server" />

That's it! Fire it up in a web browser. You'll be prompted to create the admin account and then you can start adding your media files.

The Administrator's Guide has step-by-step instructions to guide you through this process. If you have any questions, the forum is just a mouse click away. Want extra help? Hire Roger to handle the integration for you.

Membership and Role Providers

Screen shot of web-based Install Wizard

The admin area gives you complete user and role management.

Gallery Server Pro uses the ASP.NET Membership and Role provider model for user and role storage. There are two data technologies supported by default:

  • SQL Server
  • SQL CE

But you are not limited to these two. You can hook into any membership system - including your existing one - with a simple update to the web.config file.

There are even step by step directions in the Admin Guide for integrating into Active Directory.