Cascading Style Sheets

  • Thread starter Thread starter Herb Stull
  • Start date Start date
H

Herb Stull

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
 
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
 
Hey Mike,

Your suggestion worked very nicely!

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

Thanks again, Herb
 
Back
Top