Re: Can I get at contents of <head></head> programmatically?

Discussion in 'ASP .Net' started by Karl, Sep 15, 2004.

  1. Karl

    Karl Guest

    Bill
    To answer in reverse..you (or the IDE) doesn't need any of that junk.

    And no, you can't without a runat="server". You might want to consider
    looking into a masterpage system which would allow you to do this. I
    believe these (http://www.metabuilders.com/Tools/MasterPages.aspx) can do
    it.

    Karl
    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Bill Borg" <> wrote in message
    news:...
    > Hello,
    >
    > On every page, I would like to get at <head /> via code, e.g. to set

    <title
    > />, <style />, etc. All of my pages inherit from what I call TSPage.
    >
    > I know I can do this by setting <head> with id= and runat=, then adding my
    > extra stuff as literals, but that means I need to code each page with the
    > special <head>.
    >
    > I'd prefer to just add my own <head /> block as part of OnInit in TSPage,
    > but I can't figure out where to put it without a literal control already
    > there. I've tried page.controls.addat(0, myHeader), but that puts the

    control
    > even before the <html>, so it's ignored, and of course doing
    > page.controls.add puts it at the very end, which doesn't help either.
    >
    > Any thoughts?
    >
    > As an aside, is there anything I need the following stuff for? I presume
    > it's just for the IDE?
    >
    > <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    > <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    > <meta content="JavaScript" name="vs_defaultClientScript">
    > <meta content="http://schemas.microsoft.com/intellisense/ie5"
    > name="vs_targetSchema">
    >
    > Thanks,
    >
    > Bill Borg
     
    Karl, Sep 15, 2004
    #1
    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:
    823
    Brian W
    Jul 2, 2003
  2. showme

    PHP and ASP.NET go HEAD to HEAD

    showme, Jul 8, 2004, in forum: ASP .Net
    Replies:
    13
    Views:
    785
    Sherif ElMetainy
    Jul 10, 2004
  3. Guest
    Replies:
    1
    Views:
    691
    Steven Cheng[MSFT]
    Aug 16, 2005
  4. Don Adams
    Replies:
    1
    Views:
    625
    Martin Honnen
    Mar 5, 2004
  5. Jiho Han

    Write into <HEAD></HEAD> section?

    Jiho Han, Jan 14, 2004, in forum: ASP .Net Building Controls
    Replies:
    6
    Views:
    264
    Sam Fields
    Jan 16, 2004
Loading...

Share This Page