Master Page VS shtml-asp. NET Trivia (3)

Source: Internet
Author: User

Is this HTML reuse?

Web pages in many places the same, there are different places.

Take the same place in the page, extract it, and form a document.

References in other Web pages are a traditional way of thinking about website development.

Of course, different technologies have different forms of expression.

For example, php,asp these languages to write an include directly.

and in ASP.

WebForm, a master page is presented. of course, the use of master pages is not recommended in this article.

I recommend using shtml.

Master Page

WebForm master Page (MasterPage), use the master page of the form.

Simply put, the master page uses ContentPlaceHolder to dig pits,

After you create a new page that uses the master page form, use the content pits.

But for web development, the master page is too cumbersome.

sHTML

Shtml:serversideinclude (SSI), the mainstream Web server (IIS, Apache, etc.) are supported. High efficiency, no need to go through the process of ASP, lightweight.

If you play PHP ASP or something, then I have nothing to say. Because it's exactly the same way.

Of course, how to use shtml in Visual Studio is a small problem. (especially simple)

1. Create

If you haven't used it, you'll never expect it.

When you add a project to Visual Studio, you cannot find the option to shtml the file at all.

The way to create shtml, is directly in, the creation of HTML when renamed to Xx.shtml.

2. Use

There's nothing to say about this thing, for a simple example.

Like what

In index.shtml, I want to cite top.html and footer.html.

Just add such a sentence in index.shtml.

<!--#include file= "top.html"-

Index.shtml the body of the page.

<!--#include file= "footer.html"-

In fact, today, the main thing is to say shtml how to create. Frankly, a picture can be said to be clear.


Master Page VS shtml-asp. NET Trivia (3)

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.