How to understand Master Page and shtml in ASP.NET
This article focuses on "how to understand the master page and shtml in ASP.NET". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to understand master pages and shtml in ASP.NET".
The specific analysis is as follows:
Master page
Create and use master pages:
1. Create a master page (MasterPage) for Webform
two。 Create a form (ContentPage) that uses master pages.
3. Master pages use ContentPlaceHolder to dig holes, and forms using master pages fill holes with Content
The master page is the server that helps us to splice the page into response to the browser.
However, the master page is too bulky. Shtml is recommended.
Shtml
ServerSideInclude (SSI) and mainstream web servers (iis, apache, etc.) all support it. High efficiency, no need to go through asp.net processing, lightweight.
Create and use shtml:
First create two files: head.html and foot.html, and then create a test.shtml
Code reuse and file stitching are realized by adding the following code to test.shtml.
At this point, I believe you have a deeper understanding of "how to understand the master page and shtml in ASP.NET". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!