473,216 Members | 1,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 software developers and data experts.

HTML Page Templates in ASP

Is this affective way using HTML Templates in ASP:

i have html template file with <<TAG1>> .. <<TAGN>> in places, where i want
to insert some data
then i generate this data in asp

Dim d ' Create a variable.
Set d = CreateObject("Scripting.Dictionary")
d.Add "TAG1", "Athens" ' Add some keys and items.
d.Add "TAG2", "Belgrade"
d.Add "TAG3", "Cairo"

, open html template, replace each <<TAGx>> with generated data
(d.Item("TAGx") ),
and print it with Response.Write

Or there is any other usual methods to use templates?
Jul 19 '05 #1
1 1818
Hi

I usually simplyify this by surrounding the HTML "placeholders" with
the hash character:

- - -

Thank you for purchasing #PolicyType# from our website

- - -

Then I loop through the fields in the recordset and do the
replacement:

- - -

For Each str_ItemFound In obj_RecordSet1.Fields
str_Value = obj_RecordSet1(str_ItemFound.Name)
If IsNull(str_Value) Then str_Value = ""
Select Case str_ItemFound.Name
Case "Premium"
str_Value = FormatCurrency(str_Value)
End Select
str_Contents = Replace(str_Contents,"#" & str_ItemFound.Name &
"#",str_Value)
Next

- - -

Seems to be fairly efficient as long as you are not handling masses of
data

MK

"Serge" <mb*@km.ru> wrote in message news:<up**************@TK2MSFTNGP12.phx.gbl>...
Is this affective way using HTML Templates in ASP:

i have html template file with <<TAG1>> .. <<TAGN>> in places, where i want
to insert some data
then i generate this data in asp

Dim d ' Create a variable.
Set d = CreateObject("Scripting.Dictionary")
d.Add "TAG1", "Athens" ' Add some keys and items.
d.Add "TAG2", "Belgrade"
d.Add "TAG3", "Cairo"

, open html template, replace each <<TAGx>> with generated data
(d.Item("TAGx") ),
and print it with Response.Write

Or there is any other usual methods to use templates?

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dave Smithz | last post by:
Hi, Summary: Best way to divide out the HTML and PHP in some code I inherited. How can I keep the HTML files separate? Full Details: I've now been working two weeks on PHP / MySQL code I...
13
by: Michele Simionato | last post by:
What is the recommended way of generating HTML from Python? I know of HTMLGen and of few recipes in the Cookbook, but is there something which is more or less standard? Also, are there plans to...
2
by: nanookfan | last post by:
Hi all, I'm having a bizarre problem converting XML files to HTML using an XSLT. The problem is only occuring in my Netscape 7.0 browser. What makes it more bizarre is that it is only...
8
by: Matej Cepl | last post by:
Hello, does anybody have %subj%? I would like to generate some very simple HTML (XHTML?) file from OOImpress, so that I can send it to the friend for review and not bother her with all images,...
19
by: Logix | last post by:
Hello! I'm trying to make a sort of online page building system. In order to do this, I represent my page using a HTML table. One of the most basic templates would be a page divided in six...
3
by: mark wade | last post by:
Thanks for your help in advance. Hello, I am just learning HTML and are using HTML-KIT. I am wondering if HTML-Kit has a bunch of templates to choose from to build a website. I see that...
13
by: David | last post by:
jumping on the train and with such a big jump that .Net is there is something I just find hard to believe... since the arrival of Web forms (<asp:xxx/>) - will I ever need to do manual HTML code...
1
by: Hose B | last post by:
HI all, I have a legacy app in which users can pick various page templates. There is a template preview dialog. It works such that they view a list of icons in an asp page that represent each...
11
by: David Schwartz | last post by:
I'm processing some xml with xsl stylesheets and, for some reason, I have one stylesheet that does not produce the needed html tags in the output. I can't figure out why this stylesheet would be...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.