volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

embedding meta data into pages

Hi

does anyone have any suggestions on how to embed meta data into pages?  I can render the meta data on pages through an episerver property, but am unsure how to embed this data in a meta tag. Thanks.

#56128
Jan 09, 2012 0:14

You'll need to do this in the code-behind.   From memory:

var metaTag = new HtmlGenericControl();
metaTag.TagName = "meta";
metaTag.Attributes.Add("name", "keywords");
metaTag.Attributes.Add("content", CurrentPage.Property["Keywords"].Value.ToString());
Header.Controls.Add(metaTag);

    

#56130
Jan 09, 2012 3:00
Vote:

Thanks Deane, I have used the above as a basis to embed the meta data into a user control that sits within a master page...works a treat.

#56146
Jan 09, 2012 11:44
error This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.