Reading HEAD section META tag (name / content).

R

Rick

I have a base class that inherits from System.Web.UI.Page that I need
to include the ability to read the inheriting class/page meta tags. I
can't find any methods in the System.Web.UI.Page members that provide
access to do this.

What is the practice to read meta information from the head section of
an ASP.NET page?

I am using VS.NET 1.1 C# (VB is fine).

I am in a pickle here. Any help is greatly appreciated.

Best regards,

Rick
 
M

MSDN

You might be able to assign the <head> an Id and runat=server to access that
information in Code Behind.
Never tried it myself, but in 2.0 I think you can do that.

SA
 
B

bruce barker \(sqlwork.com\)

the meta data can be in a couple places, depending on how is declared on the
page. the trick is, only tags marked runat=server are parsed into individual
controls. all html between two server controls is stuffed into one generic.

page1:

<html>
<head>
<meta>
</head>
<body>
<form runat=server>

if you look in the Page.Controls collection, you will find a generic whose
inner html is the <html> thru <body> html.

page2:

<html>
<head runat=server>
<meta>
</head>
<body>
<form runat=server>

you will a generic for the <head> tag which will have a control collection
with a generic containing the meta tag(s) html

page2:

<html>
<head>
<meta runat=server>
</head>
<body>
<form runat=server>

in the page controls collection you will find a generic that is just the
meta tag.

-- bruce (sqlwork.com)
 

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

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top