Asp. Getting Started with Master pages and shtml instances in net

Source: Internet
Author: User

This paper analyzes the master page and shtml in asp.net. Share to everyone for your reference. The specific analysis is as follows:

Master Page

To create and use a master page:

1. Create the WebForm master page (MasterPage)
2. Create a form that uses a master page (contentpage).
3. The master page uses ContentPlaceHolder to dig the pit, "Use the master page form" with the content landfills

The master page is the server Help us to response the page to the browser.

However, the master page is too bulky. Recommended use of shtml.

sHTML

Serversideinclude (SSI) is supported by the mainstream Web server (IIS, Apache, and so on). High efficiency, no need to undergo asp.net treatment, lightweight.

Create and use shtml:

Create two files first: Head.html and foot.html, and then create a test.shtml

By adding the following code in test.shtml to achieve code reuse, file stitching.

1 2 3 <!--#include file= "head.html"->//here to place the custom code. <!--#include file= "foot.html"-->

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.