best way to programatically set a page's style?

Discussion in 'ASP .Net' started by PJ6, Oct 6, 2005.

  1. PJ6

    PJ6 Guest

    Instead of putting something like this in the page's HTML

    <LINK rel="stylesheet" type="text/css" href="..\Styles.css" />

    I would like to be able to have the page set its style at runtime from the
    code behind. Is it possible to do this in an OO way - that is, not have to
    get your fingers into the <HEAD> area "control" and manually add a LINK tag
    there?

    Paul
     
    PJ6, Oct 6, 2005
    #1
    1. Advertising

  2. Do you mean like Erika does ?

    http://www.dotnettreats.com/samplethemes/Default.aspx

    You can download/adapt her sample code.



    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================
    "PJ6" <> wrote in message news:...
    > Instead of putting something like this in the page's HTML
    >
    > <LINK rel="stylesheet" type="text/css" href="..\Styles.css" />
    >
    > I would like to be able to have the page set its style at runtime from the code behind.
    > Is it possible to do this in an OO way - that is, not have to get your fingers into the
    > <HEAD> area "control" and manually add a LINK tag there?
    >
    > Paul
    >
     
    Juan T. Llibre, Oct 6, 2005
    #2
    1. Advertising

  3. PJ6

    PJ6 Guest

    I don't have 2.0 yet...


    "Juan T. Llibre" <> wrote in message
    news:...
    > Do you mean like Erika does ?
    >
    > http://www.dotnettreats.com/samplethemes/Default.aspx
    >
    > You can download/adapt her sample code.
    >
    >
    >
    > Juan T. Llibre, ASP.NET MVP
    > ASP.NET FAQ : http://asp.net.do/faq/
    > Foros de ASP.NET en Español : http://asp.net.do/foros/
    > ======================================
    > "PJ6" <> wrote in message
    > news:...
    >> Instead of putting something like this in the page's HTML
    >>
    >> <LINK rel="stylesheet" type="text/css" href="..\Styles.css" />
    >>
    >> I would like to be able to have the page set its style at runtime from
    >> the code behind. Is it possible to do this in an OO way - that is, not
    >> have to get your fingers into the <HEAD> area "control" and manually add
    >> a LINK tag there?
    >>
    >> Paul
    >>

    >
    >
     
    PJ6, Oct 6, 2005
    #3
  4. Then you'll have to add the <link rel...> tag.



    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================
    "PJ6" <> wrote in message news:...
    >I don't have 2.0 yet...
    >
    >
    > "Juan T. Llibre" <> wrote in message
    > news:...
    >> Do you mean like Erika does ?
    >>
    >> http://www.dotnettreats.com/samplethemes/Default.aspx
    >>
    >> You can download/adapt her sample code.
    >>
    >>
    >>
    >> Juan T. Llibre, ASP.NET MVP
    >> ASP.NET FAQ : http://asp.net.do/faq/
    >> Foros de ASP.NET en Español : http://asp.net.do/foros/
    >> ======================================
    >> "PJ6" <> wrote in message
    >> news:...
    >>> Instead of putting something like this in the page's HTML
    >>>
    >>> <LINK rel="stylesheet" type="text/css" href="..\Styles.css" />
    >>>
    >>> I would like to be able to have the page set its style at runtime from the code
    >>> behind. Is it possible to do this in an OO way - that is, not have to get your fingers
    >>> into the <HEAD> area "control" and manually add a LINK tag there?
    >>>
    >>> Paul
    >>>

    >>
    >>

    >
    >
     
    Juan T. Llibre, Oct 6, 2005
    #4
  5. PJ6

    Patirck Ige Guest

    Well sisnce you don't have ASP.NET 2.O yet then u can use sessions or
    cookies..
    Look through :-
    http://www.brainjar.com/asp/schemes/
    Hope that helps
    Patrick


    "PJ6" <> wrote in message
    news:...
    > Instead of putting something like this in the page's HTML
    >
    > <LINK rel="stylesheet" type="text/css" href="..\Styles.css" />
    >
    > I would like to be able to have the page set its style at runtime from the
    > code behind. Is it possible to do this in an OO way - that is, not have to
    > get your fingers into the <HEAD> area "control" and manually add a LINK

    tag
    > there?
    >
    > Paul
    >
    >
     
    Patirck Ige, Oct 7, 2005
    #5
    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. =?Utf-8?B?UGF1bA==?=
    Replies:
    14
    Views:
    1,143
    Juan T. Llibre
    May 13, 2005
  2. MattB
    Replies:
    0
    Views:
    382
    MattB
    Nov 21, 2005
  3. Dan
    Replies:
    0
    Views:
    465
  4. Replies:
    0
    Views:
    417
  5. technoGirl
    Replies:
    8
    Views:
    698
    marss
    Jan 3, 2007
Loading...

Share This Page