Lightbox for ASP.NET 2.0

I've just finished creating an ASP.NET assembly for enabling Lightbox functionality on ASP.NET 2.0 based web image gallery. The idea for the control was born out a similar control - Lightbox.NET. However this control does not seem to be under development currently and the latest version gives a bunch of problems when running under medium trust websites. This control implements the functionality in a completely different way than Lightbox.NET. Also this control has a highly modified version of Lightbox scripts that allow better keyboard navigation, ability to download high-res version of displayed image and other small fixes.

The assembly contains two custom controls - LightBoxScriptManager and LightBoxHyperlink.

The LightBoxScriptManager control embeds the CSS and JavaScript files that make up the Lightbox functionality into the page that needs to use it as HTML markup. You can customize the location of the CSS, JavaScript and images for Lightbox using the properties of this control. The LightBoxHyperlink control needs to be used for each image on which you want the popup effect. You can set the name of the album, the caption, the thumbnail image as well as the full web sized image. Upon clicking the thumbnail, the Lightbox effect will run and you can then navigate within the popup.

The complete source as well as samples for this is available for free from here. This has been released under a fully permissive license, so feel free to use it wherever you wish and make whatever modifications you want. It would be nice if you can mention us, though.

To use the assembly, simply follow the instructions below:

  1. Copy the EITLightbox.dll from the Sample website's Bin/ folder to your website's Bin/ folder
  2. Also copy the entire "Lightboxnet" folder from the sample site to your website
  3. Open the ASPX page in which you wish to add the functionality. Switch to Source mode.
  4. At the top of the page, just below the @Page directive, add the following line:
    	<%@ Register Assembly="EITLightbox" Namespace="EIT.ASPNET.Controls.LightBox" TagPrefix="eit" %>			
    	
  5. Just below the <form> start on the page, add the following control markup. Make sure that the paths in the CSSPath, ImagesPath and ScriptsPath properties are correct
    	<eit:LightBoxScriptManager ID="lbsm" runat="server"
    		CSSPath="lightboxnet/css"
    	ImagesPath="lightboxnet/images"
    		ScriptsPath="lightboxnet/js" />			
    	
  6. In the place where you wish to add the image gallery add the following control markup for each image:
    	

    <eit:LightBoxHyperlink ID="lb1" runat="server" Album="My Album Name" Caption="Picture Caption #1" FullImageUrl="Images/WebSized/img1.jpg" ThumbnailUrl="Images/Thumbnail/img1.jpg" />

  7. Save and run the form.

Here are some sample screenshots of it running

Two Galleries and Usage Tips
Two galleries and usage tips
 

image
The "popup" window. Note the caption, the album image count and the navigation links.
You can navigate using the keyboard or mouse and exit the popup at any time.

Let me know what you think. BTW, this component is what powers my image gallery over at www.vinodunny.com.


Tags: , ,
Categories:

21 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Comments

nice post, thank you for sharing Laughing

December 25. 2008 08:19 | Busby SEO Test!!! United States |

can you please make it clear for number #6? i'm still confuse about that. thanks

December 27. 2008 20:16 | Belajar SEO United States |

great blog, i like it Laughing

March 15. 2009 23:42 | phreakaholic United States |

When I used your dll and code. this thing happened to me is if I use Dynamic URL, it won't show anything.
Say, I create a Imagelist as a datasource and bind the datasource to a control which contain your code. when it run, the data is bind, url is assigned, but nothing happened

March 16. 2009 09:00 | Jack Australia |

Search Value is a highly professional & technically focused Internet Marketing Company.

March 25. 2009 15:48 | Internet Marketing Company India |

fgfdgfdgdfgdfgfdndsfbsd
sdfsdfjsdbfhsdbdsjfds

sdgfsdfdshfsd
fsdfhdsfhsd
fewredhfsdfhsdf;
werhd;fhsd
fsd
fsddsf
sdfje3rjejrffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff88888888888888
f;sdhfsdfdfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
sdhwephr

April 9. 2009 11:30 | fdss Malaysia |

kjl;kl;kl;kl
hjkhjk
hjkhj
khkh
jkhjk
hjk
hjkh
jkh
jkh
jk
hkj
hkj
hj
khjk
hj
khj
khj
kjh
k
jhkh
jkh

June 19. 2009 13:47 | kljkl United States |

what a great blog, i like it.

May 5. 2009 04:29 | sulumits retsambew United States |

It's a very nice project & really helpful
Thank u so much.

May 8. 2009 16:14 | rajisivadas United States |

http://www.voip-services-provider.co.uk
Voice over IP (VoIP) software is used to conduct telephone-like voice conversations across the internet. There are many free VOIP Software available on the webs for download. VOIP Software is popular because VOIP phone service is often cheaper than traditional phone service, and is becoming more popular for both business and personal calls.
<a href="http://www.voip-services-provider.co.uk">VOIP Software</a>

May 23. 2009 12:12 | VOIP Software United States |

http://www.tricerat.com/blog
If all computer networks were alike, triCerat wouldn’t exist to solve the mundane computer tasks that are necessary to keep today’s application delivery environments running.

May 23. 2009 12:13 | Virtualization Blog United States |

A possible workaround sticked into my mind... what if instead of registering the in it Lightbox function as is it is registered with a timeout of a few milliseconds? Maybe it could be going to work... it depends much on the reason why IE7 doesn't like it to be called when the page is being rendered... I'll try.

June 19. 2009 13:35 | worst gambling bets India |

Great work, i will try it and hope it works for me. Thank you for sharing.

June 25. 2009 05:42 | öltemperaturgeber Netherlands |

http://www.ibntel.com
Each year, Americans spend billions of dollars on long distance phone service. By some estimates, at least one-fifth of that amount is wasted on excessive charges. Fortunately, by making smart decisions regarding long distance plans, consumers can avoid wasting hard earned dollars.
<a href="http://www.ibntel.com">Ibntel</a>

June 29. 2009 15:42 | Ibntel United States |

Thanks for the code.Great blog

July 1. 2009 11:13 | Online Poker |

thanks for link info, very helpful for me

July 1. 2009 20:31 | Internet Shopping Store United Kingdom |

very cool, thanks for shared

July 5. 2009 05:45 | robert United States |

I create a Imagelist as a datasource and bind the datasource to a control which contain your code. when it run, the data is bind, url is assigned, but nothing happened.

July 5. 2009 14:10 | club penguin cheats United States |

awesome articel, thanks for sharing this.

July 7. 2009 15:18 | Veyton Templates Germany |

How to make asp.net applications work without visual studio platform?

July 10. 2009 16:03 | web design United States |

interesting

July 13. 2009 00:39 | rusli Zainal Sang Visioner United States |

Comments are closed