Link to home
Start Free TrialLog in
Avatar of wilcor14
wilcor14Flag for United States of America

asked on

property evaluation failed on page.response.end()

I am receiving an error and not sure why. Here is the error:
{Property evaluation failed.}
    System.Threading.ThreadAbortException: {Property evaluation failed.}
    Data: Property evaluation failed.
    HelpLink: Property evaluation failed.
    InnerException: Property evaluation failed.
    Message: Property evaluation failed.
    Source: Property evaluation failed.
    StackTrace: Property evaluation failed.
    TargetSite: Property evaluation failed.

When I remove the Page.Response.End() everything works fine. Do I need it in there?
If File.Exists(imageFile) Then
                        Dim binStream As FileStream = File.OpenRead(imageFile)
                        Dim objImage As System.Drawing.Image = System.Drawing.Image.FromStream(binStream)
                        Page.Response.Write("<html><body style='font-size:10px;margin:0px;padding:0px;padding-left:4px;'>")
                        Page.Response.Write("<center><span style='color:blue;'>" + Path.GetExtension(imageFile).ToLower().Replace(".", "") + "</span>")
                        Page.Response.Write(" w: <b>" + objImage.Width.ToString() + "</b> h: <b>" + objImage.Height.ToString() + "</b>")
                        Page.Response.Write("</center></body></html>")
                        objImage.Dispose()
                        binStream.Close()
                        
                        Page.Response.End()
                    End If

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of srikanthreddyn143
srikanthreddyn143

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial