Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Workaround found to multiple ExplandTemplate()
Message
De
25/10/2001 20:45:55
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
West Wind Web Connection
Titre:
Workaround found to multiple ExplandTemplate()
Divers
Thread ID:
00573471
Message ID:
00573471
Vues:
49
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
Répondre
Fil
Voir

Click here to load this message in the networking platform