by Lasse Soelberg
24. September 2008 11:57
It has been a while since my last update. but to sum up what has happened, the most important part is that I got my Bachelor degree in Computer Science.
I have not made any real progress on the online gallery application since i ran into troubles with my subversion repository server. At home i have a Linksys NSLU2, on which i have installed Debian Linux. A few months ago a security issue regarding SSL was discovered and as a result of the update i lost the ability to log into it. Kind of a problem when the device is only accessible through a network connection. I spend the entire summer trying to convince myself to correct the problem, so i would be able to access my repository again, but playing Guitar Hero on my Xbox always won
, so it wasn't until i started at the university again i got it up and running.
LSGallery
What has happened with the gallery, is that i have AJAX enabled it. I put the Treeview and the Gridview in separate updatepanels, such that an update in one doesn't affect the other. And this works very nicely, except for one small detail. Since the entire page no longer gets updated when something happens, the page history doesn't get updated and thus the ability to use the back button has disappeared.
To solve the history problem i am using .NET 3.5 SP1, which adds history management to AJAX. At the moment there is added a new entry to the history, every time there is navigation event on the page. I still need to make the functionality that actually uses the history, but before i can get that working i need to make some changes to how the albums are loaded in the first place.
by Lasse Soelberg
23. April 2008 21:00
During Easter I was on a study trip to San Francisco (Fantastic trip
). I took a bunch of pictures there (510 to be exact) and I wanted an easy solution for publishing them online, since some be interesting for the other students that participated in the trip.
I decided on some features that the gallery should have. It should be made in ASP.NET and all I would have to do would be to upload the pictures to my domain with FTP, and then the gallery should take care of the rest. So the albums in the gallery should mimic the folder structure on the server, and when a folder is chosen, it should show the images as clickable thumbnails.
I did a search for this kind of gallery, and it came up empty. At least for solutions where I didn't have to pay anything. But hey, I ain't studying Computer Science for nothing, so I decided to make my own.
The Web Page
The web page has a TreeView control on the left that is used to display the menu. And then it uses a GridView control to show the thumbnails for the selected album. It has a TextBox control on the top that is used for debugging purposes. The following screenshots shows the UI of the gallery.
Some Code
I made a class called Library, where I do all the work with the images. This is where I get the list of folders, get the list of images in the folders and make thumbnails of the images. I will just show a single method from that class.
The method that gets the folders uses recursion to easily figure out the folder structure. It builds a TreeNode representation of the folders, for use in a TreeView control on the UI. The following code snippet shows the implementation of the method.
The gallery can be seen in action at http://www.soelsoft.dk/gallery/default.aspx.