Avatar of wilcor14
wilcor14
Flag 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

.NET ProgrammingVisual Basic.NET

Avatar of undefined
Last Comment
srikanthreddyn143

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
srikanthreddyn143

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23