Reading HEAD section META tag (name / content).

Discussion in 'ASP .Net' started by Rick, May 10, 2006.

  1. Rick

    Rick Guest

    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
    Rick, May 10, 2006
    #1
    1. Advertising

  2. Rick

    Rick Guest

    Anyone? WWYD?

    -Rick
    Rick, May 10, 2006
    #2
    1. Advertising

  3. Rick

    MSDN Guest

    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


    "Rick" <> wrote in message
    news:...
    > Anyone? WWYD?
    >
    > -Rick
    >
    MSDN, May 10, 2006
    #3
  4. 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)


    "Rick" <> wrote in message
    news:...
    >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
    >
    bruce barker \(sqlwork.com\), May 10, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian W
    Replies:
    10
    Views:
    764
    Brian W
    Jul 2, 2003
  2. Sergey Morkovkin
    Replies:
    5
    Views:
    17,315
    gamcfarlane
    Jul 14, 2009
  3. Luurs
    Replies:
    1
    Views:
    2,412
    Alan Silver
    Aug 8, 2006
  4. Jiho Han

    Write into <HEAD></HEAD> section?

    Jiho Han, Jan 14, 2004, in forum: ASP .Net Building Controls
    Replies:
    6
    Views:
    233
    Sam Fields
    Jan 16, 2004
  5. Sergey Morkovkin

    Insert SCRIPT or LINK tag into a HEAD section DYNAMICALLY

    Sergey Morkovkin, Sep 11, 2003, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    193
    Slava Tihonyuk
    Sep 15, 2003
Loading...

Share This Page