Interpreting ASP within templates using Microsoft Scripting Control

Discussion in 'ASP General' started by Thomas Parslow, Dec 16, 2003.

  1. Hi,

    I'm using an ASPTemplate class (the one from asptemplate.sourceforge.net) to
    produce WAP and HTML verions of the same pages. It seemed to me that it
    would be very usefull to have the template files (which are essentially just
    HTML with special tags to indicate where values should be inserted) be able
    to contain small amounts of ASP code.

    So what I'm doing is allowing normal ASP code blocks (script delimited by <%
    and %>) withing my templates, then when I display the templates I strip out
    the code blocks and run them using the microsoft scripting control (passing
    in the server, response and request objects).

    This seems to work ok but I was just wondering does anyone see any problems
    that this might cause?

    Thanks :)

    -Tom
    PS: This is ASP, not ASP.NET
    PPS: The code is very simple, if anyone wants to see it just ask
     
    Thomas Parslow, Dec 16, 2003
    #1
    1. Advertisements

  2. I am not familiar with ASP template, but the architecture idea is sound. The
    only potential issue I can see, at a glance, is not being able to easily
    debug if there is an error. If you have that conquered, you are fine.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    **********************************************************************
    Think Outside the Box!
    **********************************************************************
    "Thomas Parslow" <> wrote in message
    news:OWJ$...
    > Hi,
    >
    > I'm using an ASPTemplate class (the one from asptemplate.sourceforge.net)

    to
    > produce WAP and HTML verions of the same pages. It seemed to me that it
    > would be very usefull to have the template files (which are essentially

    just
    > HTML with special tags to indicate where values should be inserted) be

    able
    > to contain small amounts of ASP code.
    >
    > So what I'm doing is allowing normal ASP code blocks (script delimited by

    <%
    > and %>) withing my templates, then when I display the templates I strip

    out
    > the code blocks and run them using the microsoft scripting control

    (passing
    > in the server, response and request objects).
    >
    > This seems to work ok but I was just wondering does anyone see any

    problems
    > that this might cause?
    >
    > Thanks :)
    >
    > -Tom
    > PS: This is ASP, not ASP.NET
    > PPS: The code is very simple, if anyone wants to see it just ask
    >
    >
     
    Cowboy \(Gregory A. Beamer\), Dec 17, 2003
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Replies:
    1
    Views:
    1,799
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    997
    SpamProof
    Oct 21, 2003
  3. John Harrison

    using templates in templates

    John Harrison, Jul 31, 2003, in forum: C++
    Replies:
    8
    Views:
    597
    Torsten Curdt
    Jul 31, 2003
  4. JKop
    Replies:
    3
    Views:
    705
  5. Tom McCallum

    Templates within templates

    Tom McCallum, Aug 4, 2004, in forum: C++
    Replies:
    2
    Views:
    541
    tom_usenet
    Aug 4, 2004
  6. DaveInSidney
    Replies:
    0
    Views:
    667
    DaveInSidney
    May 9, 2005
  7. recover
    Replies:
    2
    Views:
    1,083
    recover
    Jul 25, 2006
  8. forgottenwizard
    Replies:
    6
    Views:
    131
    David Masover
    Sep 24, 2008
Loading...