Application of the template idea in ASP

Source: Internet
Author: User
Tags php programming
In ASP, the application of templates seems to be a new programming idea that emerged this year. In fact, many PHP programming ideas were used in the template idea a long time ago. The template mentioned here is not a template in C ++. The template mentioned in Web development is generally similar to the template in Dreamwaver, but it is actually different. Below I will illustrate the use of the template in ASP:
First of all, it is the creation of the template. Now I create a template to display my own data.
Nickname: {nickname} <BR>
Gender: {sex} <BR>
Hobbies: {fav} <BR>
Email: {email} <BR>
The above content can be directly assigned to a variable, saved to a file, or saved to a database. When used, the value is assigned to a variable. Here I set it to MyData, the following describes how to use a template:
'Mydata is pre-assigned
MyData = Replace (MyData, "{nickname}", "L. J. Y .")
MyData = Replace (MyData, "{sex}", "male ")
MyData = Replace (MyData, "{fav}", "extensive ")
MyData = Replace (MyData, "{email}", " ")
In this way, MyData is changed
Nickname: L. J. Y. <BR>
Gender: Male <BR>
Hobbies: extensive <BR>
Email: <BR>
How is it? Maybe you haven't felt the practicality of it, so you have to use it to fully understand how practical it is.
My suggestion is to save template data to data and read it later. You may say that reading template data from the database often consumes a lot of resources! Yes, but do you forget to have another Application? As long as you add a judgment, if there is no template data in the Application, you can not put it in it, which is actually very practical in large programs, because the Application is a shared object, even 10000 people use an Application, is it very economical.
Well, I just talked about my experience. Maybe this idea is really bad, or there are many places worth improving. Please give me some advice!

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.