Home » Item #272
I want to get dynamic content onto each page. How do I add asp script to the template page or use an ASP rather than HTM page as a template?
Firstly, your template must be a static file, not an ASP. Because the text of the file is read by the file scripting object (rather than the resulting HTML of an ASP page that has run being read), if you use an ASP as your template, you will just see sourcecode.
The way to achieve this is to first create a new custom tag for your new dynamic element, e.g. xxxMYNEWELEMENTxxx
Next, add the code into buildpage.asp in such a way that you create HTML as a string variable (rather than writing HTML straight to the screen).
At the foot of buildpage.asp, the tag is then replaced with this string of HTML you have generated. You should see this is how the minibasket and other dynamic items are created.