The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: Generating Good Quality Thumbnail Images in ASP.NET
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

John HazinPosted Jul 23, 2010, 1:11 PM
Hi Amit here is the mark up call <asp:Image ID="imgThumb" runat="server" ImageUrl="ThumbnailHandler.ashx?VFilePath=~/documents/pF232167k8/test.jpg & Height=230 & Width=340" AlternateText="Thumbnailimage" /> here is the source for a test image: <img id="ctl00_CPHContent_rptUploadedDocuments_ctl01_gvDocs_ctl02_imgThumb" src="ThumbnailHandler.ashx?VFilePath=~/documents/pF232167k8/test.jpg & Height=230 & Width=340" alt="Thumbnailimage" style="border-width:0px;" /> I get the standard broken image. please help John
John HazinPosted Jul 19, 2010, 4:20 PM
Hi Amit. Thanks your for help. how did you register the handler? What do I add in the web.config file if anything? or Is it done in IIS 7? Thanks. John
Amit ChoudharyPosted Jul 16, 2010, 6:28 AM
hi john, IsReusable is an Menthod of IHttpHandler interface and we need to implement. ya i forget to mention it here. It will be like this: public bool IsReusable { get { return false; } } 2. User the handler with your Hyperlink like this: <asp:HyperLink ImageUrl='<%#"ThumbnailHandler.ashx?VFilePath=~/documents/"+Eval("folder")+"/"+Eval("filename")+"&Height=230&Width=340"%>' ................./> if it won't work then put an <asp:Image ImageUrl='<%.....%>' ../> between opening and closing tag of <asp:HyperLink....> // here you image goes</asp:HyperLink> Hope all your issues solved now.
John HazinPosted Jul 15, 2010, 6:41 PM
Hi Very Nice article. However I"m having to issues 1- when I compile I get: Error 50 'ThumbnailHandler' does not implement interface member 'System.Web.IHttpHandler.IsReusable' D:\webprojects\eDENT\www\ThumbnailHandler.ashx 2- Instead of an image I'm using an ASP.Net hyperlink. Will this still work ? I get a tag is not formated well error. here is the markup <asp:HyperLink ID="hyprGridDocLink" runat="server" Text='<%# Eval("filename") %>' ImageUrl="ThumbnailHandler.ashx?VFilePath=" + '<%# "~/documents/" + Eval("folder") +"/" + Eval("filename") %>' + " & Height=230 & Width=340" NavigateUrl='<%# "~/documents/" + Eval("folder") +"/" + Eval("filename") %>' Target="_blank" /> Thanks a ton for any help john