Click here to Skip to main content
15,881,455 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi

i want to know , how to view TIFF images in my page using asp.net c#

i was tried with this code

C#
Response.ContentType = "image/tif";
Response.WriteFile(filepath);
Response.Flush();
Response.Close();


but this not display any image . its display open / save dialog
Posted

I think, that the main problem is because browsers [^] don't support TIF images for inline viewing. I tried latest Chrome 26 and IE 10. It only works in Safari. To avoid this, use PNG instead or check the alternatiff.com[^] project for TIF support.
Also proper content-type should be image/tiff (with two 'F's).
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-Mar-13 10:35am    
Correct, a 5.
—SA
Correct, adding images into the Response object will tell the browser to download them as a separate object and so you get the open save dialog.

All you need to do is add html img tags or asp.net image tags and set the src or imageurl to the url of the images.
 
Share this answer
 
Comments
Darsh_Basha 28-Mar-13 8:26am    
@ryanb31
plz tell me more
ZurdoDev 28-Mar-13 8:32am    
Have you ever created a web page? Adding img tags is trivial and is html 101. Please see http://www.w3schools.com/html/html_images.asp

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900