开发者

How to change metatags dynamically?

开发者 https://www.devze.com 2023-03-15 15:29 出处:网络
I am working on a site w开发者_运维技巧here the meta tags are set in a Masterpage in asection using runat=\"server\". I can update the title, description, keywords, etc... through properties in the Ma

I am working on a site w开发者_运维技巧here the meta tags are set in a Masterpage in a section using runat="server". I can update the title, description, keywords, etc... through properties in the Masterpage code-behind, but how would I add or edit non-basic ones such as

I have tried the following, but it always returns 0 for the count.

   Dim header As Web.UI.HtmlControls.HtmlHead
            header = TryCast(Me.Master.FindControl("headerIdName"), Web.UI.HtmlControls.HtmlHead)
            Dim count As Integer = header.Controls.Count


You have to iterate through the controls in the header:

How do I retrieve a custom meta tag in a page?

0

精彩评论

暂无评论...
验证码 换一张
取 消