get head by tagname (from server control)

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default get head by tagname (from server control)

    my server control generates part of page from codebehind. I get other part
    from different source.
    how can i get <head></head> (written inline on .aspx) from the
    ControlCollection(.aspx.vb)? For example - i would like to insert metatags.

    it looks getting it by ID(which i don't have) is the only possibillity (i
    don't want to override rendering )
    any idea(getting it by TagName maybe)?

    thnx


    Peter Licen Guest

  2. Similar Questions and Discussions

    1. Modify Head Tag from Custom Control.
      Can I or how do I modify the Head Tag using a Custom Control. I've tried adding a Literal Control and setting it's "Text" property. I get access...
    2. Write into <HEAD></HEAD> section?
      Is it possible to write into HEAD section, for example to write out a LINK tag?
    3. [PHP-DEV] [PHP-CVS] cvs: php-src / NEWS /ext/standard basic_functions.c head.c head.h
      > As Andi might say: "Why not call this http_headers()?" :) As you can probably guess, my answer to your first question is your second...
    4. control to add <LINK> inside <HEAD>
      Hi all, I'm building a custom control, which has a separate .css file with its stylesheet. I need to link to the stylesheet inside the page,...
    5. Injecting code into the <head></head> section
      Hi All, I have a web user control that, among other things, provides Print this page, and Email this page functionality I have this script that...
  3. #2

    Default Re: get head by tagname (from server control)

    If you add the runat='server' attribute to the header tags then you can
    access them from your code behind.
    Here's more info and a good example using the Title tag:
    [url]http://www.aspalliance.com/kenc/faq5.aspx[/url]

    Another option would be to turn the whole header section into a user
    control. This gives you ultimate flexibility. Then you can output whatever
    you want wherever you want within the header.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "Peter Licen" <peter.licen@nps.si> wrote in message
    news:eXKnn%239SDHA.2036@TK2MSFTNGP10.phx.gbl...
    > my server control generates part of page from codebehind. I get other
    part
    > from different source.
    > how can i get <head></head> (written inline on .aspx) from the
    > ControlCollection(.aspx.vb)? For example - i would like to insert
    metatags.
    >
    > it looks getting it by ID(which i don't have) is the only possibillity (i
    > don't want to override rendering )
    > any idea(getting it by TagName maybe)?
    >
    > thnx
    >
    >

    Steve C. Orr, MCSD Guest

  4. #3

    Default Re: get head by tagname (from server control)

    thnx, but the problem is that i don't write the inline tags. I get them and
    i have first to analyze them and, if nessesary, correct them.
    otherways, attribute id is the best choise(it has all support from
    codebehind)

    sorry for the direct replay

    "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    news:O8zOdB%23SDHA.1320@TK2MSFTNGP12.phx.gbl...
    > If you add the runat='server' attribute to the header tags then you can
    > access them from your code behind.
    > Here's more info and a good example using the Title tag:
    > [url]http://www.aspalliance.com/kenc/faq5.aspx[/url]
    >
    > Another option would be to turn the whole header section into a user
    > control. This gives you ultimate flexibility. Then you can output
    whatever
    > you want wherever you want within the header.
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD
    > [url]http://Steve.Orr.net[/url]
    >
    >
    > "Peter Licen" <peter.licen@nps.si> wrote in message
    > news:eXKnn%239SDHA.2036@TK2MSFTNGP10.phx.gbl...
    > > my server control generates part of page from codebehind. I get other
    > part
    > > from different source.
    > > how can i get <head></head> (written inline on .aspx) from the
    > > ControlCollection(.aspx.vb)? For example - i would like to insert
    > metatags.
    > >
    > > it looks getting it by ID(which i don't have) is the only possibillity
    (i
    > > don't want to override rendering )
    > > any idea(getting it by TagName maybe)?
    > >
    > > thnx
    > >
    > >
    >
    >

    Peter Ličen Guest

  5. #4

    Default Re: get head by tagname (from server control)

    Well then that boosts the second idea I mentioned, which is to make the
    whole section a user (or custom) control. Then you can render whatever you
    want.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "Peter Ličen" <peter.licen@nps.si> wrote in message
    news:ex9uaI%23SDHA.2036@TK2MSFTNGP10.phx.gbl...
    > thnx, but the problem is that i don't write the inline tags. I get them
    and
    > i have first to analyze them and, if nessesary, correct them.
    > otherways, attribute id is the best choise(it has all support from
    > codebehind)
    >
    > sorry for the direct replay
    >
    > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > news:O8zOdB%23SDHA.1320@TK2MSFTNGP12.phx.gbl...
    > > If you add the runat='server' attribute to the header tags then you can
    > > access them from your code behind.
    > > Here's more info and a good example using the Title tag:
    > > [url]http://www.aspalliance.com/kenc/faq5.aspx[/url]
    > >
    > > Another option would be to turn the whole header section into a user
    > > control. This gives you ultimate flexibility. Then you can output
    > whatever
    > > you want wherever you want within the header.
    > >
    > > --
    > > I hope this helps,
    > > Steve C. Orr, MCSD
    > > [url]http://Steve.Orr.net[/url]
    > >
    > >
    > > "Peter Licen" <peter.licen@nps.si> wrote in message
    > > news:eXKnn%239SDHA.2036@TK2MSFTNGP10.phx.gbl...
    > > > my server control generates part of page from codebehind. I get other
    > > part
    > > > from different source.
    > > > how can i get <head></head> (written inline on .aspx) from the
    > > > ControlCollection(.aspx.vb)? For example - i would like to insert
    > > metatags.
    > > >
    > > > it looks getting it by ID(which i don't have) is the only possibillity
    > (i
    > > > don't want to override rendering )
    > > > any idea(getting it by TagName maybe)?
    > > >
    > > > thnx
    > > >
    > > >
    > >
    > >
    >
    >

    Steve C. Orr, MCSD Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139