Topic: How to mix ASP and Static Web
Messaging Templates to produce dynamic content in Imail Web
Messaging.
A while back I posted a query on how to get
common HTML included in all the web messaging templates without having
to cut and paste into each one. This has to be a common problem for
anyone doing a serious makeover of the look-and-feel of the web
interface. The problem for us was that we wanted to include a common
header, sidebar, and footer on each page. These might change from time
to time and the prospect of having to edit the 50 or so web templates
each time was giving me a huge headache.
I tried using the mailwelc.txt file but
it's size limitation and other quirkyness made this unworkable...
Additionally many of you have been
discussing the desire to use ASP with Imail Web Messaging. While not the
ideal solution (I would much prefer an Object API into the Imail engine
directly) I have come up with a pretty
good solution for doing dynamic includes and executing ASP within the
web templates using JavaScript..
The solution is to include the following
JavaScript in each web template..
<script LANGUAGE="JavaScript"
SRC="http://www.yourdomain.com/asp/loadjs.asp?jsfn=top.html"></script>
The loadjs.asp could be any asp you want to
execute that puts out HTML.. The catch is that the ASP must send
back properly formatted Javascript. So all you have to do is
..
Response.Write
"document.writeln(""<h1>This is the HTML to send
back</h1>"");"
Using this method your ASP can go do what
ever it needs to and send back the results to the browser. It works
great for including dynamic ads, rotating content or any other common
code you want on every template page.
The loadjs.asp script I developed is
designed to take a querystring "jsfn=file.html", load that html, format
it into a proper javascript document.writeln command and send it
back to the browser.
If anyone is interested I would be happy to
post the jsfn.asp code for all to use...
Mike Murdock
CIO
FishingLife.com