473,804 Members | 2,184 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding style sheet dynamicaly

Hi all,

Is it possible to add the <link rel="stylesheet "....> dynamicaly. All pages
in my site use the same style sheet, and I don't want to add the link
manualy because of maintenance.

Marc
Nov 17 '05 #1
2 1333
There's no stylesheet control i'm aware of otherwise that would be the best
option.
I'd say you can either do one of two options
1. Create a Literal control and set the text to equal "<link
rel=\"styleshee t\" src=\"" + stylesource + \"">" at runtime
2. Set a variable in your Page_Load event and then bind or write this to
your link tag. <link rel="stylesheet " src="<%= stylesource%>">

"Marc Nederhoff" <ma**@netmatch. nl> wrote in message
news:bo******** **@news.cistron .nl...
Hi all,

Is it possible to add the <link rel="stylesheet "....> dynamicaly. All pages in my site use the same style sheet, and I don't want to add the link
manualy because of maintenance.

Marc

Nov 17 '05 #2
If you look at the forum system at http://synthigence.com/forum which you
could modify...

It has a "Styler" control which you put on every page. If you make it
invisible, it looks in a table and sets a stylesheet value. If it is
visible, it displays a dropdown of available stylesheets and remembers which
the user selected (in a cookie).

charles

"Janaka" <ja****@magical ia.com> wrote in message
news:Of******** ******@TK2MSFTN GP12.phx.gbl...
There's no stylesheet control i'm aware of otherwise that would be the best option.
I'd say you can either do one of two options
1. Create a Literal control and set the text to equal "<link
rel=\"styleshee t\" src=\"" + stylesource + \"">" at runtime
2. Set a variable in your Page_Load event and then bind or write this to
your link tag. <link rel="stylesheet " src="<%= stylesource%>">

"Marc Nederhoff" <ma**@netmatch. nl> wrote in message
news:bo******** **@news.cistron .nl...
Hi all,

Is it possible to add the <link rel="stylesheet "....> dynamicaly. All

pages
in my site use the same style sheet, and I don't want to add the link
manualy because of maintenance.

Marc


Nov 17 '05 #3

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

Similar topics

2
2017
by: Mark | last post by:
Hi - I want to allow users of an intranet application, to select their own colours etc. So I have a tbale in my database, which has fields called bgcolour, fontcolour etc. As I want all pages to get the users colours, I have an includes file at the top of each page: <!--#include file="userconfig.asp" --> This is:
2
3955
by: Luke Bellamy | last post by:
Hi, I have been looking for a way to incorperate several different style sheets into a web page (i.e cascading effect). I have looked into the @import statement which seems to do what I want but unfortunately restrictions on the architecture may this unfeasible. With the LINK tag I could use that but I understand older browsers dont support it properly. I will only ever have 2 style sheets. Is there a way to link one style sheet to...
5
1976
by: Andrew Poulos | last post by:
If I have an external stylesheet that is @imported into my page and it has an element that looks like this: * html td { font-style: italic; } how can I use javascript to change the font style to 'normal'? Andrew Poulos
7
3059
by: Daniel Kaplan | last post by:
I have the item below at the top of my style sheet. And it seems that the font-szie is ignored. I know that my linked style sheet is being read, and used because if I remove the font-family line, the font changes. But it appears that no matter what I do with the font-size, it is ignored, and I cannot figure out why! Any clues? At the very bottom is the entire style sheet, just incase anyone comes accross something that they feel is...
8
41528
by: pamelafluente | last post by:
Hi guys, Is it possible to add "onload" (via Javascript) a new class to the <styleheader section? If yes, how would that be done ? <style type="text/css" media="screen"> .NewStyleClass{ whatever } </style>
10
2689
by: pamelafluente | last post by:
Hi, this time I am trying to add a style on the fly.I wish equivalency with this one (only the menuItemStyle line): <head> <style type="text/css" media="screen"> ... some static styles ... ..menuItemStyle{ background:#ddeeff;border-width:1px;border-style:inset;font-family:Arial;font-size:11px
1
4741
by: tributek | last post by:
Hello, I work on a report and everything is going well... excepted the export. I have groups defined in the report so each differente groups will appear in a new sheet in Excel. Great! Question: I would like to know if it's posible to set up dynamicaly the name of the created sheets depending on the group name? thanks
4
2405
by: fjm | last post by:
Hello everyone. I’d like to know how to handle multiple style sheets. I have css tabs that have a style sheet and then I also have a separate style sheet for the content that goes inside the tab. The problem I am running into is that the tab style sheet uses attributes in the html and body and so does the content style sheet. Each one is specific to its content. The tab style sheet seems to take precedence over the content style sheet because...
4
5636
Frinavale
by: Frinavale | last post by:
So a while ago I created a Tab Strip Control (before the AjaxToolkit had theirs otherwise I would have probably just used theirs). When I looked at the AjaxToolkit control to see how they got around this problem I discovered that they're using Animations. I don't want to bloat my control with the Ajaxtoolkit's Animation stuff though. I guess I should tell you what the problem is. I have a TabStrip custom control. It's a Table that has...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.