Adding style sheet dynamicaly

Discussion in 'ASP .Net' started by Marc Nederhoff, Nov 5, 2003.

  1. Hi all,

    Is it possible to add the <link rel="stylesheet"....> dynamicaly. All pages
    in my site use the same style sheet, and I don't want to add the link
    manualy because of maintenance.

    Marc
    Marc Nederhoff, Nov 5, 2003
    #1
    1. Advertising

  2. Marc Nederhoff

    Janaka Guest

    There's no stylesheet control i'm aware of otherwise that would be the best
    option.
    I'd say you can either do one of two options
    1. Create a Literal control and set the text to equal "<link
    rel=\"stylesheet\" src=\"" + stylesource + \"">" at runtime
    2. Set a variable in your Page_Load event and then bind or write this to
    your link tag. <link rel="stylesheet" src="<%= stylesource%>">

    "Marc Nederhoff" <> wrote in message
    news:boaj4o$68l$...
    > Hi all,
    >
    > Is it possible to add the <link rel="stylesheet"....> dynamicaly. All

    pages
    > in my site use the same style sheet, and I don't want to add the link
    > manualy because of maintenance.
    >
    > Marc
    >
    >
    Janaka, Nov 5, 2003
    #2
    1. Advertising

  3. Marc Nederhoff

    charles Guest

    If you look at the forum system at http://synthigence.com/forum which you
    could modify...

    It has a "Styler" control which you put on every page. If you make it
    invisible, it looks in a table and sets a stylesheet value. If it is
    visible, it displays a dropdown of available stylesheets and remembers which
    the user selected (in a cookie).

    charles

    "Janaka" <> wrote in message
    news:...
    > There's no stylesheet control i'm aware of otherwise that would be the

    best
    > option.
    > I'd say you can either do one of two options
    > 1. Create a Literal control and set the text to equal "<link
    > rel=\"stylesheet\" src=\"" + stylesource + \"">" at runtime
    > 2. Set a variable in your Page_Load event and then bind or write this to
    > your link tag. <link rel="stylesheet" src="<%= stylesource%>">
    >
    > "Marc Nederhoff" <> wrote in message
    > news:boaj4o$68l$...
    > > Hi all,
    > >
    > > Is it possible to add the <link rel="stylesheet"....> dynamicaly. All

    > pages
    > > in my site use the same style sheet, and I don't want to add the link
    > > manualy because of maintenance.
    > >
    > > Marc
    > >
    > >

    >
    >
    charles, Nov 5, 2003
    #3
    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. Bisser Milanov
    Replies:
    2
    Views:
    515
    Bisser Milanov
    Jun 26, 2003
  2. moondaddy
    Replies:
    7
    Views:
    2,787
    Steven Cheng[MSFT]
    Feb 12, 2004
  3. Replies:
    0
    Views:
    492
  4. Totto
    Replies:
    6
    Views:
    2,241
    Totto
    Aug 22, 2006
  5. Paul
    Replies:
    2
    Views:
    121
Loading...

Share This Page