Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

RenderAspScript error

$
0
0
RenderAspScript error
Web Connection 5.0
RenderAspScript error
May. 19, 2013
02:00 pm
3SE0U1ERYShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Stein Goering

There is a bug in RenderAspScript due to some recent changes which cause the class to rely on some of hte newer Response object properties. I've fixed that by adding those properties to the script response object (they're not used in it since the base object doesn't do headers etc.) but the code works.

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.

+++ Rick ---



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










Rick Strahl
West Wind Technologies


from Maui, Hawaii

Making waves on the Web


Viewing all articles
Browse latest Browse all 10393

Trending Articles