ImageButton and SavePictureAs

G

Guest

Hi,

I'm using VS2005 to create a web site.

On one of my aspx pages I have an ImageButton that displays an image that is
created in a seperate page.


ImageButton1.ImageUrl = "EmbeddedPage.aspx";

The EmbeddedPage.aspx generates the image to be displayed and returns the
image thus:

Bitmap image;
..
.. (image generated)
..
image.Save(Response.OutputStream, ystem.Drawing.Imaging.ImageFormat.Jpeg);

This all works fine except for one small problem. If the user right clicks
on the image the file is saved with the .html extension and not .jpg. If
the extension is manually changed then the image will load correctly into an
image viewer, indicating that it is only the filename that is incorrect.

Can anyone suggest a solution so that 'save picture as' apends the correct
file extension.

Regards,
Dave.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top