Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ExpandTempate() problem when returning output
Message
De
14/08/2001 15:35:46
 
 
À
14/08/2001 15:17:41
Information générale
Forum:
Visual FoxPro
Catégorie:
West Wind Web Connection
Divers
Thread ID:
00543702
Message ID:
00543715
Vues:
13
>Assuming we call ExpandTemplate() with this:
>
>
>lcHtml=Response.ExpandTemplate('MyFile.htm',,,.T.)
>
>
>This will returns HTML output into the variable.
>
>Assuming the situation I want to call a template to store it in a variable followed by another call to store another HTM into another variable:
>
>
>lcHtml=Response.ExpandTemplate('MyFile.htm',,,.T.)
>lcHtmlEmail=Response.ExpandTemplate('MyFileEmail.htm',,,.T.)
>
>
>So, those two calls will return the output into the variables. I will then issue a Response.Write(lcHtml) later on for the first call and use lcHtmlEmail to send an email where this template represents the body of the email.
>
>The problem is that any call to Response.ExpandTemplate() issue a THIS.ContentTypeHeader(tcContentType). So, when doing the Response.Write(lcHtml), I will end up with my result followed by another content type header.
>
>Anyone found a workaround for that without having to modify WWC framework?

Well, the only way I have found for this is to process any non HTML template before the actual HTML template and clear the buffer. So, this would work:
lcHtmlEmail=Response.ExpandTemplate('MyFileEmail.htm',,,.T.)
Response.Clear()
lcHtml=Response.ExpandTemplate('MyFile.htm',,,.T.)
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform