简体   繁体   中英

Loading html page from a template on the computer

I am working with a C# on visual studios.

What I would like to know is if it is possible to have a html template loaded from a directory on my computer. Then every time I load up my code it will load up the .html template automatically.

Yes there is a way, not suggested but exist. You can use this code to include the file, inside your asp.net page.

<!--#include file="template.htm"--> 

What is dose is that is load this htm file and show it on the place that you have place this declaration. Also you must know that this file can not contain anything dynamically. This is a command code that comes from the old asp script code, and still work on asp.net

So I can not call it as template. If you wish to make something like a real template you must use a master page. Using a master page is far better, and you just copy paste your htm code inside the master page and there you have it.

relative: http://triaslama.wordpress.com/2008/11/19/how-to-include-file-in-aspnet-pages/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM