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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Andrew FensterPosted Oct 24, 2011, 4:41 PM
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:
Paul MozziePosted Oct 24, 2011, 9:39 AM
Vipul KelkarPosted Oct 24, 2011, 9:37 AM
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 MozziePosted Oct 24, 2011, 9:25 AM
Any help would be greatly appreciated, I'm quite an new c# programmer
P
Vipul KelkarPosted Oct 24, 2011, 9:20 AM
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