ASP.NET
  Home arrow ASP.NET arrow Page 5 - Slapping Together a Photo Gallery in ASP.N...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Slapping Together a Photo Gallery in ASP.NET Part II
By: Harish Kamath
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 22
    2005-04-11

    Table of Contents:
  • Slapping Together a Photo Gallery in ASP.NET Part II
  • Working with Files
  • Of Albums and Photos
  • Two Sides of a Coin
  • My Gallery
  • My Gallery - Demystified
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Slapping Together a Photo Gallery in ASP.NET Part II - My Gallery


    (Page 5 of 7 )

    In the previous section, I gave you a glimpse of what the final "Photo Gallery" might look like. While I agree that the output will not win kudos on account of its bland user interface, it should have given you a firm grasp of the programming logic that I wish to implement for my  "Photo Gallery" application.

    But before I proceed further, I would like to refresh your memory by relisting the folder structure introduced in the first part:

    E:\inetpub\wwwroot\
    +---Gallery

    +---Australia
    |    +---Christmas
        |    \---New_Year
      +---London
        |    \---The_Tube
        +---New York
        |    \---Independence_Day
        \---Singapore
            \---Shopping_Festival

    It is quite obvious that the "Photo Gallery" application assumes the above folder structure is created under the root folder of the Web server, and that proper file system permissions have been assigned to these folders. Furthermore, this two part series primarily aims to demonstrate the file management capabilities of the .NET framework. So, I wouldn't recommend that you host this application in a live environment without a thorough review of the security risks involved.

    The bottom line - you've been warned!

    Check here for the code listing.

    Save this script as "gallery.aspx" in the "wwwroot" folder (as displayed in the hierarchy above). Now, load the script -  I can access it using "http://localhost/gallery.aspx" on my local server - in order to view the following output:

    Click on the one of the "Photo Albums" to view the "Photos" present in the selected album. Take a look:

    Here, I would like to point out that it is possible to have nested "Photo Albums" - after all, they are just file system folders containing image files. Take a look at the following screen shot that displays a "Photo Album", which contains "Photos" as well as nested "Photo Albums":

    No "Photos" in a particular "Photo Album" - no sweat, this "gallery.aspx" script is programmed to handle such situations, as seen below:

    Now that I have given you a quick walk through of the application, it is time to decipher the code that has brought about this transformation. One look at that code listing and I'll bet that you are definitely not looking forward to the next section.

    Well - that’s what I am paid for. So, here goes nothing!

    More ASP.NET Articles
    More By Harish Kamath


     

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek