Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Workaround found to multiple ExplandTemplate()
Message
From
25/10/2001 20:45:55
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
West Wind Web Connection
Title:
Workaround found to multiple ExplandTemplate()
Miscellaneous
Thread ID:
00573471
Message ID:
00573471
Views:
50
In regards to the recent threads about the fact that whenever we call ExpandTemplate(), it calls ContentTypeHeader() by default which adds a header. Thus, this is causing a problem if you call ExpandTemplate() a second time as another header will be added.

The workaround is this. Create a class such as the following one. When calling ExpandTemplate(), pass that header if you don't want ExpandTemplate() to create another one when it is calling ContentTypeHeader().
lcHtml=...
loHeader=CREATEOBJECT('ExpandTemplateHeader')
lcHtml=lcHtml+Response.ExpandTemplate(gcClientFat+tcTemplate,loHeader)

DEFINE CLASS ExpandTemplateHeader AS RELATION

lPassedHTMLObject=.F.

FUNCTION GetOutput()
RETURN ''
ENDFUN

ENDDEFINE
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Reply
Map
View

Click here to load this message in the networking platform