Ironically I ran into this problem a few minutes after replying to you in - Help Builder - which uses the class to render topics. The code broke badly there as well.
I originally tried using ExpandScript but I needed to do some additional process to the resulting text before displaying it, so I tried to capture the stream by setting the llNoOutput flag:
lcHT = Response.ExpandScript(Config.cHTMLPagePath+lcTemplate,,,,.T.)
I remember having trouble getting that to work, so I looked around for an alternative and found RenderAspScript which did what I wanted at the time.
So I tried again and came to the same conclusion - the llNoOutput flag does not work for either ExpandScript or ExpandTemplate - the call just produces an empty string. What I ended up doing was this:
Response.ExpandScript(Config.cHTMLPagePath+lcTemplate)
lcHT = Response.Getoutput()
Response.Clear()
lcHT = STREXTRACT(lcHT,[<!DOCTYPE],[],1,5)
The Getoutput result includes the HTTP header so I had to use that last command to strip it off...
Why are you using this method in a Web application? Can't you use ExpandTemplate/Script to do this?
Yes something has changed there and it's broken code that runs outside of a Web Connection server or where the Response object is not in scope or not used directly.
+++ Rick ---
I'm calling your wrapper function in wwUtils - which in turn creates a wwScripting object and calls its RenderAspScript method...
What are you doing exactly? How are you calling RenderAspScript? It's not a function but a method...
+++ Rick ---
I'm getting Property Not Found errors when trying to execute this line of code:
lcHT = RenderASPScript(Config.cHTMLPagePath+lcTemplate)
The errors are coming from wwscripting and reference Response.Status and Response.RenderHttpHeader
IF (llResponseCreated)IFthis.lError
Response.Status = "500 Server Error"
Response.ContentType = "text/html"ENDIF
_Out = Response.RenderHttpHeader() + _OutENDIF
This code has been in place for years and was working prior to upgrading to WC 5.66. Did something change in the scripting engine?
FWIW, I don't have problems rendering wcs pages when calling them directly - just when trying to render from within another method.
--stein