Cascading Style Sheets

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
 
M

Michael

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
 
H

Herb Stull

Hey Mike,

Your suggestion worked very nicely!

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

Thanks again, Herb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top