Is it possible to change the stylesheets of a website depending on the time of day of the user's computer. Using c# ?
Regards,
P
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vipul KelkarRank #1,061 · 1.8K reputationPosted Oct 24, 2011, 5:20 AM EDT
this might be possible through Jquery as the addClass method of jquery allows you to change syling at runtime
http://api.jquery.com/addClass/
so with a few conditions defined you might be able to change the styling
Paul Mozzie5 reputationPosted Oct 24, 2011, 5:25 AM EDT
Any help would be greatly appreciated, I'm quite an new c# programmer
P
Vipul KelkarRank #1,061 · 1.8K reputationPosted Oct 24, 2011, 5:37 AM EDT
As you are saying that you need to change the image based on the USERs time, you need to get the client side time. once you have this, you can use jquery's ".css" method to change the image. the method takes property name and value as parameters which you would be able to provide. try this link
http://api.jquery.com/css/
Paul Mozzie5 reputationPosted Oct 24, 2011, 5:39 AM EDT
Andrew FensterRank #983 · 2K reputationPosted Oct 24, 2011, 12:41 PM EDT
If you also want to get the local time for use on the server, you can use Javascript to detect the local time and then store it in a hidden field:
The script: