I have an .aspx page that looks like this:
<%@
Page language="vb"
Inherits="thumb"
AutoEventWireup="false"
CodeFile="thumb.aspx.vb" %>
And the code behind looks like this:
Public Sub Page_Load(ByVal sender
As Object,
ByVal e As System.EventArgs)
Try
' --- all my rendering code ---
' send the image to the viewer
SendImage(outImage)
Catch ex As Exception
Response.Write(ex.ToString.Replace(Chr(10), "<br>"))
End Try
End Sub
'Page_Load
Try
' set the mime type
Response.Clear()
Response.ContentType = "image/Jpeg"
' send the image to the viewer
inImage.Save(Response.OutputStream, ImageFormat.Jpeg)
Catch ex As Exception
Throw New ApplicationException(ex.ToString)
End Try
End Sub 'SendImage
In .Net 1.1 I could put a page with an image tag like this:
<img src='thumb.aspx...'>
And get the image, rendered through the code in the .aspx page. Now it doesn't work... the resulting Content Type I get is not image/Jpeg, but text/html.
Any thoughts?
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.