Last post Dec 04, 2011 06:05 PM by mynickname
Aug 03, 2009 02:55 PM|NYCharles|LINK
Hi guys, does anybody use FancyBox JQuery popup here?
I encounter a weird problem when I combine Handler (.ashx) and FancyBox to display image. The image render correctly on the webpage, but not inside of the FancyBox JQuery popup.
Here is my code for the Handler (.ashx), is there anything wrong with it?
/// Summary description for $codebehindclassname$
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class GetImage : IHttpHandler
public void ProcessRequest(HttpContext context)
HttpContext.Current.Response.ContentType = "image/jpeg";
public bool IsReusable
Oct 07, 2009 05:59 AM|vfarmak|LINK
In order to use fancy box and jquery with asp.net, you have to display the image in a dummy aspx webpage.
The dummy aspx web page must have an <asp:Image> server control, in which the ImageUrl Property must have the url of your ImageHandler.
<asp:Image ID="myImage" runat="server" ImageUrl="ImageHandler.ashx"/>
Oct 07, 2009 09:10 AM|NYCharles|LINK
I fixed this problem. It seems the Fancy Box jQuery was looking for the file extension in order to present the content.
Now my image source link is "ImageHandler.ashx?file=sky.jpg"
Originally I had "ImageHandler.ashx?fileID=2", that is why it is giving me ASCII text instead of an image.
Dec 04, 2011 06:05 PM|mynickname|LINK
Could you please show more form your handler? I have the same problem :(