Lightbox for ASP.NET 2.0

 

I read this article and found it very very informative

the original author can be found at www.vinodunny.com

The article link is light box with 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 website. 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.
  "

 

kick it on DotNetKicks.com  Shout it

About these ads
  1. #1 by Unknown on May 15, 2009 - 4:35 pm

    Hi,Great blog with interesting informations. I can use it t solve my problem.Thanx

  2. #2 by web on March 17, 2009 - 9:06 am

    Lightbox Rocks (Y)

  3. #3 by Usman on September 1, 2008 - 3:37 pm

    sorry psycrow last comment"
    i have just viewed your web again it is set to 1.1
    Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
     make it 2.0 or what ever version you are using and bingo its fixed :)"
    was not for you accediently added.
     
    one other important aspect is that  the compilation tag is defined and closed at the same place  <compilation debug="true"/>. Because of this the buildProviders are out of compilation tag. Since it is a child element of the compilation tag it is displaying the error.After changing it as <compilation> <buildProvider></buildProvider></Compilation>
    hope this resolves the issue.

  4. #4 by Paul Anthony on August 29, 2008 - 7:00 am

    got happy when I saw this… but…I got a parse error in my website but in my local machine it is ok. http://www.margz.com/paul/shopftdl/jackets.aspx here is the site.. can you please help me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: