473,698 Members | 2,302 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The user determines the Site

My site is all one color basically. But I'd like to give the user the ability to make the site a color of their choice. I have it set up so that they can choose the color of the logon page and save that to favorites if they want. This basically uses a Internet Explorer propietary function.

Anyway after they save the logon page to favorites\bookm ark in the color of their choice, I'd like to make the rest of the site that color. I'm thinking a cookie? Or maybe use JavaScript to write to a cookie and use that to determine the CSS I'll use for the bgcolor attribute of the <BODY>. Any suggestions how to accomplish this? Thanks.

--
George Hester
_______________ _______________ ____
Jul 20 '05 #1
4 1332

What I did, is created a different CSS file for each color ... and
then dynamically write the line to link the right CSS file.

check it out ... www.coolpier.com and www.hotpier.com are the same
site in the same web directory ... click the little button in the
upper right hand corner to toggle between them.

granted, I have some images dynamically written as well, but anyway

some ASP code you could use would look similar to this ...

<%
Select Case Request.QuerySt ing("siteColor" )
Case "blue", "red", "green"
theColor = Request.QuerySt ing("siteColor" )
Case Else '// default purple
theColor = "purple"
End Select
%>

<link rel="stylesheet " type="text/css" href="/cp/_main/stylesheets/<%
=theColor %>_yourstyle.cs s">

Brynn
www.coolpier.com

On Sun, 11 Jan 2004 03:51:41 GMT, "George Hester"
<he********@hot mail.com> wrote:
My site is all one color basically. But I'd like to give the user the =
ability to make the site a color of their choice. I have it set up so =
that they can choose the color of the logon page and save that to =
favorites if they want. This basically uses a Internet Explorer =
propietary function.

Anyway after they save the logon page to favorites\bookm ark in the color =
of their choice, I'd like to make the rest of the site that color. I'm =
thinking a cookie? Or maybe use JavaScript to write to a cookie and use =
that to determine the CSS I'll use for the bgcolor attribute of the =
<BODY>. Any suggestions how to accomplish this? Thanks.

--=20
George Hester
______________ _______________ _____


Jul 20 '05 #2
Well I only want the one line in the CSS:

body {bgcolor: color;}

That's a lot of CSS files about 160 in all. There has to be a better way. But I'll look through that. Thx.

--
George Hester
_______________ _______________ ____
"Brynn" <z@z.com> wrote in message news:40******** *******@news.co mcast.giganews. com...

What I did, is created a different CSS file for each color ... and
then dynamically write the line to link the right CSS file.

check it out ... www.coolpier.com and www.hotpier.com are the same
site in the same web directory ... click the little button in the
upper right hand corner to toggle between them.

granted, I have some images dynamically written as well, but anyway

some ASP code you could use would look similar to this ...

<%
Select Case Request.QuerySt ing("siteColor" )
Case "blue", "red", "green"
theColor = Request.QuerySt ing("siteColor" )
Case Else '// default purple
theColor = "purple"
End Select
%>

<link rel="stylesheet " type="text/css" href="/cp/_main/stylesheets/<%
=theColor %>_yourstyle.cs s">

Brynn
www.coolpier.com



On Sun, 11 Jan 2004 03:51:41 GMT, "George Hester"
<he********@hot mail.com> wrote:
My site is all one color basically. But I'd like to give the user the =
ability to make the site a color of their choice. I have it set up so =
that they can choose the color of the logon page and save that to =
favorites if they want. This basically uses a Internet Explorer =
propietary function.

Anyway after they save the logon page to favorites\bookm ark in the color =
of their choice, I'd like to make the rest of the site that color. I'm =
thinking a cookie? Or maybe use JavaScript to write to a cookie and use =
that to determine the CSS I'll use for the bgcolor attribute of the =
<BODY>. Any suggestions how to accomplish this? Thanks.

--=20
George Hester
______________ _______________ _____

Jul 20 '05 #3
In article <N4************ ********@twiste r.nyroc.rr.com> , "George Hester"
<he********@hot mail.com> writes:
Well I only want the one line in the CSS:

body {bgcolor: color;}

That's a lot of CSS files about 160 in all. There has to be a better =
way. But I'll look through that. Thx.


Then dynamically insert the color code on the server. Only one .css file.

Set a cookie.
When the page loads, read the cookie.
Set the color.
--
Randy
Jul 20 '05 #4
Why not:

<script type="text/javascript">
function getColorFromCoo kie() {
return 'blue';
}
document.writel n('<style type="text/css">');
document.writel n('body { background-color: ' + getColorFromCoo kie() + '; }');
document.writel n('</style>');
</script>

Obviously you replace getColorFromCoo kie() with your own code that reads the cookie.

George Hester wrote:
Well I only want the one line in the CSS:

body {bgcolor: color;}

That's a lot of CSS files about 160 in all. There has to be a better way. But I'll look through that. Thx.

--
George Hester
_______________ _______________ ____
"Brynn" <z@z.com> wrote in message news:40******** *******@news.co mcast.giganews. com...

What I did, is created a different CSS file for each color ... and
then dynamically write the line to link the right CSS file.

check it out ... www.coolpier.com and www.hotpier.com are the same
site in the same web directory ... click the little button in the
upper right hand corner to toggle between them.

granted, I have some images dynamically written as well, but anyway

some ASP code you could use would look similar to this ...

<%
Select Case Request.QuerySt ing("siteColor" )
Case "blue", "red", "green"
theColor = Request.QuerySt ing("siteColor" )
Case Else '// default purple
theColor = "purple"
End Select
%>

<link rel="stylesheet " type="text/css" href="/cp/_main/stylesheets/<%
=theColor %>_yourstyle.cs s">

Brynn
www.coolpier.com

On Sun, 11 Jan 2004 03:51:41 GMT, "George Hester"
<he********@hot mail.com> wrote:
My site is all one color basically. But I'd like to give the user the =
ability to make the site a color of their choice. I have it set up so =
that they can choose the color of the logon page and save that to =
favorites if they want. This basically uses a Internet Explorer =
propietary function.

Anyway after they save the logon page to favorites\bookm ark in the color =
of their choice, I'd like to make the rest of the site that color. I'm =
thinking a cookie? Or maybe use JavaScript to write to a cookie and use =
that to determine the CSS I'll use for the bgcolor attribute of the =
<BODY>. Any suggestions how to accomplish this? Thanks.

--=20
George Hester


--
| Grant Wagner <gw*****@agrico reunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #5

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

Similar topics

8
1654
by: joe | last post by:
Some time ago I set up an ASP application that used a login page which checked a username and password against a database to determine a users authorization to access certain pages on the site. This was done by setting a session variable within the application if the user was authorized and using code one each page for which protection was required to check for the status of the session variable. Now I am aware of the various techniques...
11
1681
by: Lloyd Sheen | last post by:
Is there any one who has actually done this. I have now scanned more web articles about this with the realization that not one of them (including MSDN docs) outlines how to do this. This is beyond frustration. It seems that with every new VS release the documentation falls further behind. What I want to do should be simple but I can find no way to do it with VS with any visual designer support. I thought the 'V' in VS stood for...
1
1195
by: Charles A. Lackman | last post by:
Hello, I have created a User Control within Visual Studio and it contains a button that allows the user to querry a database. I dynamically add additional controls to the page based on the number of rows retured inside a dataset. All works well, but I have noticed that the control is rendered after the WebForm's load event is fired. This creates duplicate controls in certain situations. I have been able to prevent this from happening...
4
1529
by: sck10 | last post by:
Hello, I built a web site on our companies intranet. Is there a way to get the user information (user name, machine name etc.) when a person views a web page? -- Thanks in advance, sck10
5
2779
by: footballhead | last post by:
I have a site that has MANY different clothing categories. I have a page set up for displaying the products (productsearch.aspx) when a user clicks one of the category links on the navigation menu. I would like to have a different user control that gets loaded as a sub-header for each category (ie, tee shirts, shoes, backpacks, etc.) The category user controls include images and links to refined searches specific to each category. So...
4
4102
by: luna | last post by:
Where does this function get the name from ? reason i ask is, a user wanted their name changing on the domain, i fixe everything else (email,login etc etc) but this function still displays the old name cheers mark
2
1198
by: edsuslen | last post by:
I am trying to migrate from asp to asp.net and having problem replacing include with user control. On every page we have include asp that have some common asp code that I need to run before the page code kicks in, but user control code is always running after the page code. I am even registering and placing user control before my page initialization, but still it's running after. <%@Register TagPrefix="FindSessionUC"...
1
2181
by: rudjohn | last post by:
I've been tasked with the not-enviable job of creating an application with multiple, semi-customizable templates. My basic concept, thus far, has been a combination of Master Pages (for layout) and WebPartZones. Each master page implements an interface (call it IMasterPage), which provides public properties for the WebPartManager and 3 WebPartZones. (Rule #1 was static number of zones.) However, each template can have these zones be...
18
23783
by: Arthur | last post by:
Hi All, I would like to get the name of the user given their networkID, is this something Active Directory would be useful for?(For intranet users) If so, can you please point me to some sample code/examples? Thanks in advance, Arthur
0
9157
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...
1
8895
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
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7728
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...
0
5860
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
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
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.