META Tags Uniqueness for WebForms which use MasterPages

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 ?
 
G

Goofy

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#"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top