ASP. NET basics 02 _ topic and master

Source: Internet
Author: User

 

Use of master pages

In

You can add a master on this template page,

 <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder>

 

This server control adds content for the subpage,

 

Right-click the template page to add a subpage. In the subpage

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"></asp:Content>

 

This control corresponds to the ContentPlaceHolder control in the master. The ID of ContentPlaceHolderID must be consistent with the ID of ContentPlaceHolder on the master page.

Note the priority of page execution.

 

 

 

About the TreeView Control

Right-click Add new item, add the Web. sitemap file for it, and then add the SiteMapDataSource data to provide the control.

The SiteMapDataSource control automatically searches for the Web. sitemap file and then provides data. It is mostly used for navigation.

 

 

 

Theme)

The folder is already distributed to a single topic. The folder name is the topic name.

Topic files are generally files with the skin suffix. The App_Themes file will be created to store all style files here.

Header label

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" Theme="" StyleSheetTheme="Blue" %>

 

Theme uses the Theme file, and StyleSheetTheme uses the Theme file. The application methods are basically the same.

The main difference between the two is that the call priority is different.
If Theme is set to red and StyleSheetTheme is set to blue, the Theme style is displayed. This is the difference.

The loading order is the merge of the last three.

 

Principle: change the style Link (css) in the head tab of the page during running)

 

You can change theme: Page. Theme = "value" in the PreInit event of the Page ";

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.