How to change a web page's background image according to time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bansari
    New Member
    • Jul 2010
    • 20

    How to change a web page's background image according to time

    hi..i am asked to change the homepage's background image on each hour.i am using c#.and visual studio 2008.
    Is it possible with timer control?if yes then how?
    And is there any other way? kindly help.plz.thanks in Advance!
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    You could use a timer control to postback to the server ever hour if you wanted to.

    But you're going to have to have to implement something server-side that is responsible for getting the next image every hour.

    So, use an application wide variable to store the DateTime of the last time that the image was changed...if it has been more than an hour, implement that sets the URL to the "next image".

    -Frinny

    Comment

    • bansari
      New Member
      • Jul 2010
      • 20

      #3
      Can you help with some code? means as i m novise.i dnt know how i would change Url to next image ?

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        How are you currently setting the image url?

        -Frinny

        Comment

        Working...