Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Change BG color on Client side and store it till browser close.

Change BG color on Client side and store it till browser close.

Scheduled Pinned Locked Moved ASP.NET
question
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vkumar09
    wrote on last edited by
    #1

    I have 2 buttons.on each button click i want to change the back color of page and want to display this color till browser closes.How can i achive this.

    A B D 3 Replies Last reply
    0
    • V vkumar09

      I have 2 buttons.on each button click i want to change the back color of page and want to display this color till browser closes.How can i achive this.

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      koushiksaha wrote:

      I have 2 buttons.on each button click i want to change the back color of page and want to display this color till browser closes.

      I didn't get your point,:confused::confused: can you be more specific ? Thanks in advance!!!

      cheers, Abhijit My Recent Article : Beginner's Guide to ASP.NET Application Folder

      V 1 Reply Last reply
      0
      • V vkumar09

        I have 2 buttons.on each button click i want to change the back color of page and want to display this color till browser closes.How can i achive this.

        B Offline
        B Offline
        Brij
        wrote on last edited by
        #3

        If you want to change the color then it's better if you go for theme.

        Cheers!! Brij

        1 Reply Last reply
        0
        • V vkumar09

          I have 2 buttons.on each button click i want to change the back color of page and want to display this color till browser closes.How can i achive this.

          D Offline
          D Offline
          Dominic Goulet
          wrote on last edited by
          #4

          Create an event handler on your buttons click. Set the body element to be runat="server". On the click events, do a Body.BackgroundColor = Color.TheColorYouWant. With the body set to runat="server", it will store the information in the page viewstate. It will keep that color until you change it again.

          ______________________ Dominic Goulet FroggedSoft My blog

          V 1 Reply Last reply
          0
          • D Dominic Goulet

            Create an event handler on your buttons click. Set the body element to be runat="server". On the click events, do a Body.BackgroundColor = Color.TheColorYouWant. With the body set to runat="server", it will store the information in the page viewstate. It will keep that color until you change it again.

            ______________________ Dominic Goulet FroggedSoft My blog

            V Offline
            V Offline
            vkumar09
            wrote on last edited by
            #5

            I want to change the color at client side.On server side it changes ..there is no problem.But my requirment is on client side.

            D 1 Reply Last reply
            0
            • A Abhijit Jana

              koushiksaha wrote:

              I have 2 buttons.on each button click i want to change the back color of page and want to display this color till browser closes.

              I didn't get your point,:confused::confused: can you be more specific ? Thanks in advance!!!

              cheers, Abhijit My Recent Article : Beginner's Guide to ASP.NET Application Folder

              V Offline
              V Offline
              vkumar09
              wrote on last edited by
              #6

              I have 2 html buttons.On each button click i want a different color for my page.Now i want to do it on client side ie...using javascript...not posting the page.I want to store the color till the browser closes.How can i achive this.

              1 Reply Last reply
              0
              • V vkumar09

                I want to change the color at client side.On server side it changes ..there is no problem.But my requirment is on client side.

                D Offline
                D Offline
                Dominic Goulet
                wrote on last edited by
                #7

                Okay so you just have to use javascript to achieve that.

                document.body.style.backgroundColor = '#000000'; // black

                ______________________ Dominic Goulet FroggedSoft My blog

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups