>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.)