Dynamically change page title and meta tags in C#
Change page title and meta tags dynamically/programmatically in C#.net
to change page title
Page.Title = “New Page Title”;
to change meta tags
// Create instances of an HtmlMeta control.
HtmlMeta hm1 = new HtmlMeta();
HtmlMeta hm2 = new HtmlMeta();
// Get a reference to the page header element.
HtmlHead head = (HtmlHead)Page.Header;
// Define HTML elements
hm1.Name = “keywords”;
hm1.Content = “keywords of your web page”;
head.Controls.Add(hm1);
hm2.Name = “description”;
hm2.Content = “description of your web page”;
head.Controls.Add(hm2);
Related posts:
- Magento: Set/Change page layout, title tag, meta keywords and description
- What are Meta-Tags? Full Description of Meta tags
- Magento: Show/Hide website to search engines by adjusting robots meta tag
- Magento: How to change default page layout?
- Magento: Set title, keywords and description in your module
- Page refresh in PHP
- jQuery: Grey out background and preview image as popup
- Magento: How to change or reorder top links?
- How to show child page (sub page) list in parent page in wordpress?
- WordPress: Optimizing 404 Page Not Found page
