Use the HTML Server Control to set the HTML elements of pages using masterpage

Source: Internet
Author: User

The HTML Element Information is set in masterpage and can be applied to all pages using masterpage. in practice, not all pages use the same things, such as <link>, title <title>, and meta information <meta> in CSS files.
The HTML server control can be used to set the HTML information of pages using masterpage. This method is used in the default page of dotnetnuke.

The following is a simple example:

Dim Keywordshtmlmeta As   New Htmlmeta

Keywordshtmlmeta. Name= "Keywords"
Keywordshtmlmeta. Content= "ASP. NET, blog, cnblogs, rippleyong"
Page. header. Controls. Add (keywordshtmlmeta)

DimCsshtmllinkAs NewHtmllink

Csshtmllink. href = " ~ /Style.css "
Csshtmllink. Attributes. Add ( " REL " , " Stylesheet " )
Csshtmllink. Attributes. Add ( " Type " , " Text/CSS " )
Csshtmllink. Attributes. Add ( " Media " , " All " )
Page. header. Controls. Add (csshtmllink)

More examples of setting head markers
Sue's edreams.org post
More HTML server controls:
HTML Server Control

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.