ASP. Dynamic Settings Title title Keyword Keywords Description descrtptions

Source: Internet
Author: User

The recommended simple practices are as follows:

protected void Page_Load (object sender, EventArgs e)
{
Page Title
Page.title = "This is a Title and Meta test page.";

Encode/content type
Htmlmeta encode = new Htmlmeta ();
Encode. HTTPEQUIV = "Content-type";
Encode. Content = "text/html; Charset=utf-8 ";
PAGE.HEADER.CONTROLS.ADD (encode);

Language
Htmlmeta lang = new Htmlmeta ();
Lang. HTTPEQUIV = "Content-language";
Lang. Content = "ZH-CN";
Page.Header.Controls.Add (lang);

Description
Htmlmeta desc = new Htmlmeta ();
Desc. Name = "Description";
Desc. Content = "Test the meta controls";
PAGE.HEADER.CONTROLS.ADD (DESC);

Keyword
Htmlmeta keywords = new Htmlmeta ();
Keywords. Name = "keywords";
Keywords. Content = "Title,meta,test,page";
PAGE.HEADER.CONTROLS.ADD (keywords);

Link/css
Htmllink Csslink = new Htmllink ();
Csslink.href = "Masterpage.css";
CSSLINK.ATTRIBUTES.ADD ("rel", "stylesheet");
CSSLINK.ATTRIBUTES.ADD ("type", "text/css");
PAGE.HEADER.CONTROLS.ADD (Csslink);
}

ASP. Dynamic Settings Title title Keyword Keywords Description descrtptions

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.