Cascading Style Sheets

Discussion in 'ASP .Net' started by Herb Stull, Jan 22, 2004.

  1. Herb Stull

    Herb Stull Guest

    I'm trying to give users a choice of the visual interface used in my ASP.NET
    application using Cascading Style Sheets.

    Ideally I'd like to offer them several choices for backgrounds, fonts, etc.
    for the screens and controls and let them make a choice. Once they choose,
    all screens and controls will display using the guidelines from the style
    sheet selected.

    I've figured out how to add a class to the style sheet for the different
    server controls and even how to apply it in the html document using a "Link"
    statement in the <HEAD> section of the document.

    What I haven't figured out is how to make that dynamic.

    The goal would be to store their style-sheet preference in a SQL Server
    table and then refer to this each time a webpage is loaded to render it with
    the style selected.

    I just can't seem to find a way to output the "link" statement to the
    document with a reference to the required style sheet.

    Does anyone have a clue of what I'm talking about and how to fix it?

    Thanks for your help... Herb
    Herb Stull, Jan 22, 2004
    #1
    1. Advertising

  2. Herb Stull

    Michael Guest

    you can "cheat", and do it like you would do in asp.
    <link rel="stylesheet" type="text/css" href="<%=getCSS%>">

    Then in code you just have a

    Public Function getCSS as string
    return "path/to/my/css/file.css"
    End Function

    If anyone else has a better way I sure would like to know.
    --Michael

    "Herb Stull" <> wrote in message
    news:40101412$...
    > I'm trying to give users a choice of the visual interface used in my

    ASP.NET
    > application using Cascading Style Sheets.
    >
    > Ideally I'd like to offer them several choices for backgrounds, fonts,

    etc.
    > for the screens and controls and let them make a choice. Once they choose,
    > all screens and controls will display using the guidelines from the style
    > sheet selected.
    >
    > I've figured out how to add a class to the style sheet for the different
    > server controls and even how to apply it in the html document using a

    "Link"
    > statement in the <HEAD> section of the document.
    >
    > What I haven't figured out is how to make that dynamic.
    >
    > The goal would be to store their style-sheet preference in a SQL Server
    > table and then refer to this each time a webpage is loaded to render it

    with
    > the style selected.
    >
    > I just can't seem to find a way to output the "link" statement to the
    > document with a reference to the required style sheet.
    >
    > Does anyone have a clue of what I'm talking about and how to fix it?
    >
    > Thanks for your help... Herb
    >
    >
    >
    Michael, Jan 22, 2004
    #2
    1. Advertising

  3. Herb Stull

    Herb Stull Guest

    Hey Mike,

    Your suggestion worked very nicely!

    Cheating or not, that's what I'm going to use in my app.

    Thanks again, Herb



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Herb Stull, Jan 22, 2004
    #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. JezB
    Replies:
    5
    Views:
    2,090
  2. =?Utf-8?B?SmltIEhlYXZleQ==?=

    Cascading Style Sheets

    =?Utf-8?B?SmltIEhlYXZleQ==?=, Jun 6, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    369
    Cowboy \(Gregory A. Beamer\) [MVP]
    Jun 7, 2004
  3. John
    Replies:
    2
    Views:
    463
    nicholas
    Dec 16, 2004
  4. Fred Nelson
    Replies:
    1
    Views:
    2,676
    =?Utf-8?B?bGF0aGEgdmFsbGluYXlhZ2Ft?=
    May 5, 2005
  5. Todd Cary

    Re: Cascading style sheets

    Todd Cary, Dec 5, 2003, in forum: HTML
    Replies:
    0
    Views:
    398
    Todd Cary
    Dec 5, 2003
Loading...

Share This Page