p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   C# 2005 (http://p2p.wrox.com/forumdisplay.php?f=138)
-   -   change color of background (http://p2p.wrox.com/showthread.php?t=63541)

meena88 November 6th, 2007 05:14 AM

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.



meena

Imar November 6th, 2007 06:00 AM

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


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004

irProject December 1st, 2009 02:33 AM

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_Start(...)
{
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.

Imar December 1st, 2009 04:48 AM

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....

Cheers,

Imar


All times are GMT -4. The time now is 12:58 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.