472,378 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 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 1931
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
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.