Set Meta In Asp.net

Source: Internet
Author: User

Meta Tags undoubtedly play a major role in website promotion. Search engines use meta tags to obtain webpage-related information, such as keywords and description. If ASP. net to dynamically generate pages, especially when using template pages, it seems that you cannot add meta information to each page. Otherwise, you can add meta information to your own ASPX page by programming.

Protected void page_load (Object sender, eventargs E)
{
Htmlmeta metakeywords = new htmlmeta ();
Htmlmeta metadeworkflow = new htmlmeta ();

Metakeywords. Name = "keywords ";
Metakeywords. content = "milk ";
Metadeworkflow. Name = "Description ";
Metadegion. content = "** Brand milk ";
Header. Controls. Add (metakeywords );
Header. Controls. Add (metadeworkflow );
}

You can store keywords and description in the database, Dynamically Retrieve them, and configure the webpage. It is worth noting that multiple tags must be added to multiple htmlmeta and then added to the header.

Original path: http://hi.baidu.com/lieqer/blog/item/b67cef829e019392f603a60b.html

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.