Lightbox photos in

First of all I am a novice on

I have an aspx page with connection to a sql2005 server. I have tried to add a lightbox photo gallery object to the Gridview. I had help on getting it started however I seem to have lost my source on help for the moment. The page works when pulling data from the SQl dbase until I add in the lightbox feature. Here is the code in the page. I get the error on the IIS server when I try to run the page.
error CS0103: The name 'Image1' does not exist in the current context
I can't find a reference of Image1 anywhere
<asp:GridView ID="grdProjects" runat="server">
        <asp:DataList ID="grdProjects" runat="server">
          <table width="527" border="0" align="center" cellpadding="0" cellspacing="0">
		      <td width="87" valign="bottom">&nbsp;</td><td width="262"></a>
		      <td width="168">&nbsp;</td>
		      <td width="10">&nbsp;</td>
		      <td height="28" colspan="3" align="left" valign="top"><strong class="AFSCSS"><asp:Label ID="lblProjectName" runat="server"
            text= '<%# Eval("ProjectName") %>' />&nbsp;&bull;&nbsp;
            <asp:Label ID="lblCity2" runat="server"
                    Text='<%# Eval("City") %>' />
            <asp:Label ID="lblState2" runat="server"
                    Text= '<%# Eval("ProjectState") %>' /></strong></td>
<!-- ----LightBox --->
		      <asp:Repeater ID="RepeaterLightBox" runat="server">
              <td width="87" valign="bottom">
              <a id="LightBoxImage" href="images/projects/ina.jpg" width="62" height="58"  
			rel="lightbox[Photo]" title="my caption">
                        <img id="pic" src="images/projects/ina.jpg" alt="No Image Available!" />
                <asp:Repeater ID="RepeaterLightBox" runat="server">
                        <a id="LightBox_Content" href="<%#DataBinder.Eval(Container.DataItem,
			 "PhotoName")%>" rel="<%#DataBinder.Eval
					(Container.DataItem, "rel")%>"
			 title="<%#DataBinder.Eval(Container.DataItem, "GroupName")%>"> </a>
		      <td colspan="2" align="left" valign="top" class="textsmall">Client: <span style="color: #03F"><asp:Label ID="lblClient" runat="server"
                    text='<%# Eval("Client") %>' />&nbsp;&ndash;&nbsp;</span><span style="color: #03F"><asp:Label ID="lblClientType" runat="server"
                    text='<%# Eval("ClientType") %>' /></span><br>
		        Number of Buildings:<span style="color: #03F"><asp:Label ID="lblNOB" runat="server"
                    text='<%# Eval("NumberOfBuildings") %>' /></span><br>
              Number of Units: <span style="color: #03F"><asp:Label ID="lblNOU" runat="server"
                    text='<%# Eval("NumberOfUnits") %>' /></span><br>
              Project Description: <span style="color: #03F"><asp:Label ID="lblDescription" runat="server"
                    text='<%# Eval("ProjectDescription") %>' /></span></td>


Open in new window

Bill WarrenIT ManagerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Make sure you insert Snippet 587816 this into your template.
After that add class lightbox to the link that you want to open into a lightbox window.
Also make sure to add bellow code to your page:

<script type="text/javascript">
$(function() {
      $('a.lightbox').lightBox(); // Select all links with lightbox class
This code will do all the trick -> it will add an onclick handler for the link that will open the href of the link into a lightbox window.
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.lightbox-0.4.js"></script>

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.