Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 6th, 2007, 05:14 AM
Registered User
Join Date: Nov 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default change color of background

I need to change the background color like when the user logs in for the first time the bgcolor should be green and if the user logs in without logging out then the bg color should be red. I need to make use of 'sessions'. Your help will be very much appreciated.Thanks.

Old November 6th, 2007, 06:00 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Why do you *need* to use sessions? Who says that?

Also, it might help to specify the environment you are working in to get a better answer than mine....


Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Old December 1st, 2009, 02:33 AM
Friend of Wrox
Join Date: Nov 2009
Posts: 156
Thanks: 13
Thanked 16 Times in 16 Posts

you can use sessions, but you are not forced to.
by sessions you can do like this:
when a sessions starts you can set a propery of session to 'true'
Session["isFirstTime"] = true;

and in your pages check that if Session["isFirstTime"] is true then set background of page to Green and then set Session["isFirstTime"] to false.
and for next times check that if Session["isFirstTime"] is false, then background of page should be red.
Old December 1st, 2009, 04:48 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi irProject,

This is a two-year old post!! You may want to check the posts' dates and determine whether it's worth posting a reply, reviving an old and potentially dead thread.... In this case, the OP didn't even bother to reply, so it's definitely not worth reviving IMO....


Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change background color using CSS pigtail Javascript How-To 9 April 4th, 2010 11:13 AM
change background color of inputbox vickriz Javascript How-To 3 December 1st, 2009 02:22 AM
change background color of toolbar control myth12345 VB How-To 1 January 6th, 2005 12:25 AM
Change the background color of a msgbox nobreferreira VB.NET 2002/2003 Basics 3 October 28th, 2004 09:37 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.