The ASP Emporium
Free Active Server Applications and Examples by Bill Gearhart
Online since Friday January 7, 2000

 home > code > classic asp apps > HTMLTemplate Object

enter a phrase to search:(advanced search)


 h o m e 

 w h a t 's  n e w 

 a l l   c o d e 
  .net:
    • Fundamentals
    • C# Classes
  classic asp:
    • Code Library
    • ASP Apps
  general:
    • Tutorials
    • SQL

 d o w n l o a d s 

 u s e r   f o r u m s 

 l i n k s 

 s e a r c h 

 s u p p o r t 


HTMLTemplate Object

The HTML Template Object is a lightweight class whose sole purpose is to completely separate HTML from server side ASP code. Through the use of special HTML templates, a web page can be created by setting the parameters of the HTMLTemplate object to match those found within the chosen HTML template. There are also several system and environmental variables available to a template file in addition to any user created template variables although these can be disabled to speed up processing of the templates.

The template file used to power this example can be found here.

The ASP Emporium - Env and Sys Functions
  • The system date function: @sysDate returns 7/4/2009
  • The system time function: @sysTime returns 3:15:51 AM
  • The system date/time function: @sysNow returns 7/4/2009 3:15:51 AM
  • You can also get anything out of the request.serverVariables ASP collection by prepending the argument name with @env.
    • The @envPATH_INFO variable returns: /aspapps.asp
    • The @envSERVER_NAME variable returns: www.aspemporium.com
    • The @envREMOTE_ADDR variable returns: 38.103.63.59
    • The @envREQUEST_METHOD variable returns: GET
    • The @envSERVER_PORT variable returns: 80
    • The @envSERVER_SOFTWARE variable returns: Microsoft-IIS/5.0
    • The @envHTTP_REFERER variable returns:
    • The @envHTTP_USER_AGENT variable returns: CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
    • The @envAUTH_TYPE variable returns: