The application of template idea in ASP

Source: Internet
Author: User
Tags php programming
Template
The application of the template in ASP seems to be a new idea of programming this year, in fact, a long time ago, PHP programming thought most of the use of template thinking. The template described here is not a template in C + +, Web development said that the template is generally similar to the template in Dreamwaver, but in fact is different, I would like to illustrate the use of templates in asp:
First of course is the creation of templates, now I create a template to display their own data

--------------------------
Nickname:{nickname}<br>
Gender:{sex}<br>
Love:{fav}<br>
Mailbox:{email}<br>
---------------------------

You can assign the above variables directly to a variable or save it as a file, or save it to a database, and then assign that value to a variable when used, and here I'll set it to MyData, and here's how to use the template:
--------------------------------
' MyData is already assigned.
Mydata=replace (MyData, "{Nickname}", "L.j.y.")
Mydata=replace (MyData, "{sex}", "Male")
Mydata=replace (MyData, "{fav}", "extensive")
Mydata=replace (MyData, "{email}", "webmaster@tale99.com")
---------------------------------
So MyData is changed into a
Nickname:l.j.y.<br>
Sex: Male <BR>
Hobbies: Extensive <BR>
Mailbox:webmaster@tale99.com<br>

What do you think? Perhaps you have not yet felt its practicality, but you have to use it fully aware of how practical it is.
My advice is to save the template data to the data, and then read it later, you may say that for frequently used template data, often read from the database will consume a lot of resources! Yes, but did you forget to have another application? As long as you add a judgment, if there is no template data in the application, you put it on the line, which is actually very practical in large programs, because application is a common use of the image, even if the 10000 people are also using a application is not very economical.
Hehe, I just talk about my experience, maybe this thought is really bad, or there are many places worth improving, please advise!



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.