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"--> |