There are two javascript script files
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JQueryLightBoxExample.aspx.cs" Inherits="JQueryLightBoxExample" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>JQueryLightBox Example</title>
<link rel="stylesheet" type="text/css" href="../style-projects-jquery.css" />
<!-- Arquivos utilizados pelo jQuery lightBox plugin -->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.lightbox-0.5.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" />
<script type="text/javascript">
$(function() {
$('#gallery a').lightBox();
});
</script>
<style type="text/css">
/* jQuery lightBox plugin - Gallery style */
#gallery {
background-color: #444;
padding: 2px;
width: 800px;
}
#gallery ul { list-style: none; }
#gallery ul li { display: inline; }
#gallery ul img {
border: 5px solid #3e3e3e;
border-width: 5px 5px 20px;
}
#gallery ul a:hover img {
border: 5px solid #fff;
border-width: 5px 5px 20px;
color: #fff;
}
#gallery ul a:hover { color: #fff; }
</style>
</head>
<body>
<form id="form1" runat="server">
<div id="gallery">
<asp:DataList ID="FeaturedList" runat="server" RepeatLayout="Table" Width="100%" RepeatColumns="5">
<ItemTemplate>
<div>
<ul>
<li>
<a href='<%#getHREF(Container.DataItem)%>' title='<%# DataBinder.Eva
(Container.DataItem, "Rep_FirstName")%>'>
<img src='<%# getSR
(Container.DataItem) %>' align="top" title='<%# DataBinder.Eval(Container.DataItem, "Rep_FirstName")%>' height="100" width="100">
</a>
</li>
</ul>
</div>
</ItemTemplate>
</asp:DataList>
</div>
</form>
</body>
</html>
Code Behind :
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;
using System.Data.SqlClient;




Mehmet KuzuPosted Mar 5, 2019, 1:34 AM
Good sample, do you have how to save a picure or path adress as guid to mssql
said djelmoPosted Aug 25, 2015, 3:31 PM
dont work, image open in new window ?
parul maheshwariPosted Nov 21, 2012, 6:44 AM
in css, zoom: 1 attribute is not working with IE and Mozila firefox.
brian streeterPosted Aug 3, 2012, 11:43 PM
How did you store the images and what kind of naming convention did you use in the SQL DB? Or I should say what does Rep_ID and Rep_Img_Name consist of? Any help would be appreciated.
Nirbhay SinghPosted Oct 19, 2011, 11:31 PM
Can you please let me know about tables column return ResolveUrl("~/Rep_Images/" + dRView["UserId"].ToString() + "/" + dRView["Rep_Id"].ToString() + "/" + "Real" + "/" + dRView["Rep_Img_Name"].ToString());
Mahesh ChandPosted Jan 5, 2011, 11:24 AM
Good work. Do you need to install JQueryLightBox or can the DLL be a part of this project?
Spyros PonarisPosted Jan 5, 2011, 8:51 AM
It is really nice . keep coding