META Tags Uniqueness for WebForms which use MasterPages

  • Thread starter Thread starter Goofy
  • Start date Start date
G

Goofy

I was wondering how to go about setting the keywords for pages whichg derive
from MasterPages, and then I thought I know, lets put a runat=server on the
keywords meta tag and set the content.

<meta id="pageKeywords" runat=server name=keywords content="" />

and then use the code in the page to access this.

'set keywords

Dim kwds As System.Web.UI.HtmlControls.HtmlMeta

kwds = Page.FindControl("pageKeywords")

kwds.Attributes.Item("content") = "vb.net,asp.net,c#"

But this does not seem to work. Any ideas?, or is this a cr*p way of doing
it ?
 
OK, I solved it Needed to use the master property

'set keywords

Dim kwds As System.Web.UI.HtmlControls.HtmlMeta

kwds = Me.Master.FindControl("pageKeywords")

kwds.Attributes.Item("content") = "vb.net,asp.net,c#"
 
Back
Top