473,382 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Cascading Style Sheets

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

Nov 18 '05 #1
2 2022
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" <st*****@nauticom.net> wrote in message
news:40**********@news.nauticom.net...
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

Nov 18 '05 #2
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!
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: Axel Dahmen | last post by:
I try to combine properties of several classes. This is done by assigning a space separated list of class definitions to an element. However, IE shows a kind of preference when choosing the right...
2
by: pp | last post by:
What would you say about a smart script that would transform really 'cascading' style sheet into appropriate CSS structures. When coding css by hand, most often you are forced to write the...
5
by: JezB | last post by:
Is it possible to programatically examine and modify a page's Styles (including Cascading Style Sheets) within the code-behind-module (eg. c#) ? My guess is that since these are HTML elements the...
1
by: Jim Heavey | last post by:
Hello, I am hoping I have a very basic question for Cascading Style Sheets If I am using an ASp:Panel control and I have a number of controls in the panel, how do I get the controls to all...
1
by: Fred Nelson | last post by:
Hi: I have a VB.NET web application that has been running just fine for several months without any cascading style sheets. Suddenly several users have had problems with the layout of the...
5
by: Peter Walburn | last post by:
Hi, I am writing a web based application in VB.Net. A lot of the forms in the applicaiotn have grids (datagrids) in them. I would like to have a style sheet which defines how the headers are...
4
by: Fred Nelson | last post by:
Hi: I have a VB.NET web application that has been running just fine for several months without any cascading style sheets. Suddenly several users have had problems with the layout of the...
9
by: Radium | last post by:
Cascading Style Sheet is an extreme hazard to your privacy. It allows others on the internet to see your monitor and files. It allows them to copy images on your monitor to their computers. It...
5
by: MarkW | last post by:
I hope this is the correct place to post this: I am developing a web site for a e-commerce business I will be running. The site I'm setting up will be 50% store, 50% content. I'm not sure which...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.