Forum Moderators: open
I would like to have a response page template in the the template I place acomment tag in the cell where I want the response text to appear after the form has been processed.
If I was doing this in perl I would read the template page line by line and run each line through a regex to replace my comment tag "<-- Response text here -->" with the desired Screen output. Then print the final output.
Can I do something similar in ASP I have been mucking around with the FSO tonight and have successfully read in the template but can't do the replace.
Any help appreciated
Colin
You have Page A, that has an form on it. This Page submits it's info to itself, and you want to show a message selected from a file.
Why not make a Function like this (pseude code) :
Function getTextFromFile(Byval EntryName) Call OpenTemplateFile()
getTextFromFile = RetrieveFromTemplateFile(EntryName)
End Function
RetrieveFromTemplateFile should read the line that starts with "entryName" and return the string
And put getTextFromFile("ResponseTemplate01")there instead of the comment code.
The response page text differs depending on the users selections in the Form. It may be as much as two paragraphs.
The idea of having a template is that the person I sell the script to can then change templates and my script will still work, Provided he puts the template in the same place each time and includes the comment tag in the place he wants the response text to appear in the page.
If I hardcode the Response page output into the form processing page, he has to always get me to make any changes. This way I do us both a favour.
With a view to making this script future proof one could include the path to the response page as a hidden field in the form.
Colin