Home > .net 2.0, c#, SQL, Visual Studio 2005 > Creating a Photo Gallery, Part #5

Creating a Photo Gallery, Part #5

May 21, 2007

It’s finally here!  The fifth and final installment of the now called WebStorage project is up and ready to read.  You can read the final part here via PDF.  Note that I’m not posting the body of the PDF here on the blog as it seems, as of late, that almost ANY HTML formatting is overridden by WordPress and spacing is totally thrown off. 

From the first page:


Creating a Photo Gallery, Part #5

Well, this is the final part to this quick (albeit somewhat delayed) tutorial. So far, we’ve covered:

Part #1

  1. Reading and writing images from a web site to the hard drive,
  2. Automatically generating thumbnails using Image.GetThumbnailImage().

Part #2

  1. Provide rudimentary file type verification on uploaded files,
  2. Reading and writing images from a web site to a SQL Server/Express database,
  3. Creating custom handlers based off of the IHttpHandler interface.

Part #3

  1. Using a DataList control to display our photos on the web,
  2. Update the HttpHandler created in Part #2 to auto-gen photos and thumbnails,
  3. Create the basic “gallery” framework.

Part #4

  1. Translate our prior framework to a more “object oriented” approach,
  2. Add the ability, in our HttpHandler, to render multiple file types, such as PDFs and Word DOCs.

So, in Part #5, we’re going to wrap things up with:

  1. The implementation of galleries,
  2. The management of galleries—creating and deleting.


For those interested in the source code thus far, please leave a comment and I’ll send you the code.  WordPress does not allow uploading compressed files.  Perhaps a great reason for me to actually implement the WebStorage into production and carry on… 🙂

Tags: , , , ,

  1. horsted
    May 22, 2007 at 9:11 am

    Hi again,

    I have been waiting in anticipation for the last gallery part =) Glad too see it’s here – good job!
    I would very much like the source code, if you are still willing to share.
    Thanks in advance – will be checking my mailbox alot =)

    Cheers, horsted

  2. May 22, 2007 at 9:13 am

    I emailed it out to you; thanks!

    To others, I’ll try to actually implement it up this weekend and add ZIP and RAR as valid file types… so I can post my own files. *sigh* Hindsight is 20/20.

  3. Irving Chen
    June 6, 2007 at 8:42 am


    Nice job! The photo gallery project is what I’m looking for.
    Could you send me the codes?



  4. July 24, 2007 at 8:42 am

    Hi There,

    this seems everything I need for a gallery my friendgirl was asking for.

    Could you please send me the code??

    Many thanks!!


  5. July 24, 2007 at 8:55 am

    Marlon –

    Sent 🙂


  6. July 24, 2007 at 12:59 pm

    Hi There,

    This seems everything I need for a gallery!

    Could you please send me the code??

    Many thanks!!


  7. Vinay
    October 11, 2007 at 4:55 am

    Hi David,

    Can you please email me the code for the photo gallery, Thanks in advance


  8. somy
    November 7, 2007 at 4:47 am

    hi david

    please email me the code for the photo gallery
    Many thanks!!

  9. Alfredo C
    January 15, 2008 at 10:20 am

    Hi David,
    great work, just what I was looking for! please send me the code.

  10. January 20, 2008 at 12:44 am

    Hey, David,

    Excellent write-up. I’m just learning and would love to get a copy of the source code. Thanks!


  11. January 27, 2008 at 1:23 pm

    @Alfredo and Mark-

    Code can be downloaded here.

  12. Zdenek
    February 1, 2008 at 6:16 am

    Hallo, good it’s very nice and comment’s are good for beginner.
    Could you send me the code for testing?

  13. February 1, 2008 at 8:24 am


    Code can be downloaded here.

  14. Zdenek
    February 7, 2008 at 2:05 pm

    hallo Dave, link not work :-((

  15. February 8, 2008 at 6:51 am

    Fixed. Had a bit of a snag the other day that deleted the file repository; missed reuploading that file. 🙂

  16. Zdenek
    February 13, 2008 at 8:17 am

    hallo Dave, I install gallery on my localhost, create SQL tables, proper connect sring – but have trouble system cannot find

    I have Microsoft .NET Framework version:2.0.50727.1433; version ASP.NET:2.0.50727.1433
    Microsoft.Practices.EnterpriseLibrary downloaded and installed

    – any advice ?

  17. Zdenek
    February 13, 2008 at 8:19 am

    cannot find line.4. web.config —– section name=dataConfiguration type=”Microsoft.Practices.EnterpriseLibrary…………..

  18. February 13, 2008 at 8:27 am

    @Zdenek –

    Do you have the Microsoft Enterprise Library installed?

    http://msdn2.microsoft.com/en-us/library/aa480453.aspx to download them. Be sure to verify the version numbers against what’s used in the project.

    I’m working up a series of blog posts and new version of WebGallery right now (http://photos.tiredstudent.com has what it looks like, I’ve already (mostly) upgraded that site) using .NET 3.5. It removes the dependency on EntLib and uses LINQ instead.

  19. Zdenek
    February 13, 2008 at 11:28 am

    I have Enterprise Library 3.1 – May 2007 , but I do not know how to configure
    but another question – when I want to put on to internet provider – there will be trouble with Enterprise Library dependence !!!

  20. February 13, 2008 at 12:18 pm


    No, there will not be any trouble if you right-click the Enterprise Library libraries under References and click “Copy Local”. That includes the libraries in your /bin directory when you build and/or publish.

    3.1 May 2007 sounds right–hmm. To configure them, you should simply need to reference them.

  21. Zdenek
    February 13, 2008 at 1:22 pm

    in bin directory I have :

    after installation of Enterprise lib – in program files is configuration tool – I do not know how it work

  22. bigtory
    February 19, 2008 at 8:43 pm

    Hi David,
    Good morning.
    Good job, I am studing to display images in a directory to datalist.
    Please send me the code.
    Thanks so much.
    South, Korea..

  23. February 20, 2008 at 6:47 am

    @bigtory –

    You can download the files here . 🙂

  24. Bill
    December 30, 2008 at 10:40 am

    Hi David,
    I’ve really enjoyed how your series of articles evloved through the process of creating this photo gallery.

    I would really like to see the code.



  25. March 20, 2009 at 5:04 am

    This seems everything I need for a picture gallery!

    Could you please send me the code??

    Many thanks!!

  1. No trackbacks yet.
Comments are closed.
%d bloggers like this: