|
GalleryNET is a free and open source project for creating
online Gallery. It’s written in Microsoft © C# and ASP.NET. It provides a certain
level of flexibility for the end-users to customize the display style. The most
exciting feature is, once the template and style sheet files are done, the end-users
can simply upload additional galleries and image files to the web-server via FTP.
Without writing any code, the new files will be automatically populated by the control.
GalleryNET borrows the LGW (Lightbox
Gone Wild) idea from Kevin Hale. Thanks a lot to his work. I made some modification
based on the comments from that page; also, I added a new feature to position the
popup.
Live Demonstration
This is the live online demonstration of GalleryNET. You can download the full source
code of both the web controls and website from here.
Sample Code
Using GalleryNET web control is fairly easy. First, you need to declare to include
the control in your page:
<%
@
Register Assembly="IC.Web.GalleryNET"
Namespace="IC.Web.GalleryNET.Controls"
TagPrefix="cc1"
%>
Then you can place the control:
<cc1:GalleryGrid BorderStyle="Dashed" ID="galleryGrid" runat="server" RepeatColumns="3" RepeatDirection="Horizontal" SubFolderDisplayMode="Complex" AllowPaging="true" PageSize="9" CellSpacing="0" CellPadding="3" HorizontalAlign="Center"
Width="640"
PagerMode="NumericPages"
ErrorMessageCssClass="errorMessage">
<pagerstyle
cssclass="pager"
/>
<subfoldertablestyle
cssclass="subfolder"
/>
</cc1:GalleryGrid>
Please refer to the development guide for more details on each property. In this example, it specifies:
- use “Complex” mode to display the subfolders;
- allow paging
- each page has maximum 9 images
- display numeric page indices
- and some css classes for different blocks
There are two web controls in the GalleryNET: GalleryGrid
and GalleryImage. Behind the scene, GalleryGrid is a System.Web.UI.WebControls.DataList,
and it will always turn on Footer and Header, unless you disable Paging and subfolder display. GalleryImage
is a CompositeControl. It’s a template-based control, but instead of writing a data bound control, I used a different technique to render data. It’s easier to code and buildup the template, the drawback is the developer cannot use code-insight of VS.NET. Please refer to ShowImage.aspx for more details.
|