C
chandy
Hi,
I am trying to set meta data in an asp.net 2.0 application. I tried
this:
<meta name="keywords" content="" id="metaKeywords" runat="server" />
with this in the codebehind:
metaKeywords.attributes("content") = "my keywords"
but the html meta tag that this output was like this:
<meta id="_ctl0_Meta1_metaKeywords" name="Keywords" content="my
keywords"></meta>
it no longer terminated with / > and added a closing tag instead!
So instead I tried it all codebehind and used the new HtmlMeta class:
Dim metaKeywords As New HtmlMeta()
metaKeywords.Name = "Keywords"
metaKeywords.Content = "my keywords"
Me.Controls.Add(metaKeywords)
This time it just rendered an old HTML 4.0 tag:
<meta name="Keywords" content="my keywords">
Again not what I want.
So, how do I get asp.net to render an xhtml-compliant meta tag that
ends with /> ?
Thanks,
Chandy
I am trying to set meta data in an asp.net 2.0 application. I tried
this:
<meta name="keywords" content="" id="metaKeywords" runat="server" />
with this in the codebehind:
metaKeywords.attributes("content") = "my keywords"
but the html meta tag that this output was like this:
<meta id="_ctl0_Meta1_metaKeywords" name="Keywords" content="my
keywords"></meta>
it no longer terminated with / > and added a closing tag instead!
So instead I tried it all codebehind and used the new HtmlMeta class:
Dim metaKeywords As New HtmlMeta()
metaKeywords.Name = "Keywords"
metaKeywords.Content = "my keywords"
Me.Controls.Add(metaKeywords)
This time it just rendered an old HTML 4.0 tag:
<meta name="Keywords" content="my keywords">
Again not what I want.
So, how do I get asp.net to render an xhtml-compliant meta tag that
ends with /> ?
Thanks,
Chandy