| |

VerySource

 Forgot password?
 Register
Search
Author: 嗜骨如命

Have you ever made a website that dynamically loads the template page html front-end display content?

[Copy link]

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-12-21 11:00:01
| Show all posts
The simpler way. Use <!-- #include file="" --> to introduce the template. About the tag {title} in the template. These can be managed separately. Specially generate static page index.htm. Finally, directly include the final index page generated.
Reply

Use magic Report

1

Threads

7

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-12-21 12:00:01
| Show all posts
The problem is not comprehensive. Use this <!-- --> situation to introduce a template, which does not meet the requirements and does not develop well. Modify trouble! ! !
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-12-21 17:00:01
| Show all posts
Trouble modifying? ? If you modify only the template, it is enough. The code does not need to be modified at all. I don't know where to trouble.
Reply

Use magic Report

1

Threads

7

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-12-21 21:00:02
| Show all posts
My current idea is to store the template in the database, then dynamically read the database table to call the template content, then use regular expressions to read the tags, and then replace the final result, and then output. But this is a bit more troublesome, but decided to make it static, so that it takes up less resources.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-12-21 21:15:01
| Show all posts
I feel that if you want to perform template analysis completely in the background, it seems that waiting for the instrument to give up many advantages of .NET

First, replace the content in the HTML page, and then load some controls
This is a bit similar to what we are currently doing (this project is very BT, so I also hate it)
We implement self-analysis for each element.
That is to say, the work done by IIS and the browser is implemented by code, and the HTML code is directly output.
It is combined into an HTML page and displayed. This can solve the pre-processing of many controls in the background. But it has abandoned many advantages of .NET.

In fact, if the number of visits is not very large, you can put all the controls in a site, and each element has its own visit page.
In your INDEX. In ASPX, convert those tags you need to replace into URLs and use REQUEST to access the access pages of those elements. Replace the HTML from GET with INDEX. Those marks in HTM
Reply

Use magic Report

1

Threads

7

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 Thailand

 Author| Post time: 2020-12-21 21:30:01
| Show all posts
I don't use any .net controls, but generate static pages, but the backend is .net. The label design uses a custom format defined by myself, and uses regular expressions to retrieve and replace.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-12-22 11:30:01
| Show all posts
I have done a similar website, but it is not as troublesome as the original poster, just replace the corresponding tag with the content, and then generate a html, the content is relatively simple, it is news
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-12-22 11:45:01
| Show all posts
Controls are also used in the template. . This is more troublesome

This is the best way. . Is the background control automatically generates an aspx page

You can refer to discuz's template engine!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list