using fancy box and httphandler to load images

瘦欲@ 提交于 2019-12-12 04:48:16

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/11943673/using-fancy-box-and-httphandler-to-load-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!