chobo
chobo

Reputation: 32301

How to change metatags dynamically?

I am working on a site where 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

Upvotes: 0

Views: 452

Answers (1)

Steve Wellens
Steve Wellens

Reputation: 20638

You have to iterate through the controls in the header:

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

Upvotes: 2

Related Questions