Question

I am using JQuery fancybox for photos. I want to load the images from database using HttpHandler but can not get the image. my code for the jquery

$(document).ready(function(){
 $('#gallery a').fancybox();
});

asp.net code

 <div style="float:left; position:relative; margin:10px;" id="gallery">
  <div>
   <a href="ImageHandlerFullSize.ashx?ImID=<%# Eval("Id")%>" rel="gallery" >
   <asp:Image ID="Image1" runat="server" ImageUrl='<%#"ImageHandler.ashx?ImID="+    Eval("Id") %>'  BorderStyle="Solid" BorderWidth="1px" Width="172px"  Height="172px"/>
    </a>

  </div>

it loads the fancybox but just displays "System.Data[]" instead showing the message. Thanks.

Was it helpful?

Solution

Try

$(document).ready(function(){
 $('#gallery a').fancybox({
  "type":"image"
 });
});

check http://fancybox.net/faq No.6 for v1.3.x ... or http://fancyapps.com/fancybox/#support No.5 for v2.x

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top