3

On IIS 10 (on older IIS servers everything works fine) after some later updates when I work with class in script (*.asp), that was executed (server.execute) from another script then all response.write code written in Class_Terminate() is written to the end of parent body outside the HTML element where it shoud be.

<div>
<%server.execute ("somescript.asp")%>
</div>

Result from Class_Terminate() in this example is written under the div element. When I include the script instead of executing, everything works fine. The only functional workaroud is to add content of Class_Terminate() to another Sub or Function (like Sub WriteOutput()) in Class and call it at the end of the work with class.. Something like this

set Class1=new MyClass
with Class1
...
...
    .WriteOutput
end with
set Class1=nothing

Is there any other way? For example to change some setting on the side of IIS? Or is this just a bug, which is going never to be corrected (its classic asp in 2020 I know..) and I have to change the code of all classes?

Flakes
  • 2,422
  • 8
  • 28
  • 32
Pepyk
  • 31
  • 1
  • Have you got `Response.Buffer =True`? – user692942 Jul 31 '20 at 08:34
  • 3
    Take a look at [this](https://stackoverflow.com/q/60089691/893670). The problem you are having is the effect of the same bug on ASP Classic. Still no fix. The workaround is filthy as you can see there. – Kul-Tigin Jul 31 '20 at 11:03
  • Lankymart > yes i do have Response.Buffer = True – Pepyk Aug 12 '20 at 06:34
  • 1
    Kul-Tigin > thanks for reply, but easier for me is to replace the class_terminate() with some other function and close objects that way. But of course I have it as a temporary solution. – Pepyk Aug 12 '20 at 06:39

0 Answers0