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!