Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Using ASP.Net 3.5's ListView To Display Image Galleries (LightBox and LightView User Controls)

The first time I laid eyes on the lightbox image gallery I fell in love with the UI and presentation. Since then, I have been meaning to get around to jamming the js code written by Lokesh Dhakar into an ASP.Net control so that I can reuse at will.  Although my schedule doesn't permit me building a full blown server control, I did have time to hack together a working user control. In fact the day after I created the LightBox version I found LightView, a variation on LightBox, and quickly morphed and created a version for it. I don't think that there is anything extremely complicated with what I have implamented, so I will spare you the long drawn out explanation.  But, If I get enough questions or requests I may throw together something. If you have VS 2008, you should be able to unzip and run these websites as is.  You might need to modify the solutions VirtualPath to run from "/" if you are running the site through the debugger (Scott can tell you how to do this: http://weblogs.asp.net/scottgu/archive/2006/12/19/tip-trick-how-to-run-a-root-site-with-the-local-web-server-using-vs-2005-sp1.aspx. It says VS 2005 but it is set the same in 2008).

http://idisk.mac.com/jaredroberts/Public/wwwLightBox.zip

http://idisk.mac.com/jaredroberts/Public/wwwLightView.zip 

Troubleshooting:

  1. Check the Setup instructions found at http://www.huddletogether.com/projects/lightbox2/ and http://www.nickstakenburg.com/projects/lightview/. You may need to modify the path to your images if you change the directory structure.
  2. You must set the path on the control of the image gallery you want to diplay in the format of "~/gallery1","~/gallery50", etc.
  3. If you want to display image types other then .jpg, you will need to open the asxc.vb file and modify the appropriate line number.

Version 2

I hope to import in the image handler that I have that will auto resize the images so that the thumbnails are actually thumbnails and not just resizes of the original. I also hope to put this into a server control. 

Feel free to improve this as you see fit and keep my up on the changes. Enjoy!

 

9 Comments

Comments have been disabled for this content.