ASP. NET calls HTML website template instances

Source: Internet
Author: User

Today, website templates are prevalent. Many websites use the template technology. The most common example is PHP. Now many PHP uses templates, so we are considering the trend. Today we also bring ASP. NET template calling problems. I have also written examples about ASP templates before. In fact, the methods are similar, but the forms are different.

Next I will explain the specific methods for you. Main Methods:

The Code is as follows: Copy code
Public string GetInterIDList (string strfile)
{
String strout;
Strout = "";
If (! File. Exists (System. Web. HttpContext. Current. Server. MapPath (strfile )))
{
}
Else
{
StreamReader sr = new StreamReader (System. Web. HttpContext. Current. Server. MapPath (strfile), System. Text. Encoding. Default );
String input = sr. ReadToEnd ();
Sr. Close ();
Strout = input;
}
Return strout;
}

The above method is mainly used to read the template and then load it.

The method called below is used directly:
GetInterIDList ("Template/index.html"); // This method is mainly used to drop the Template, which is mainly the Template path.

In future programs, templates will inevitably increase, because templates have many advantages.

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.