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. How to Change the background Colour of Button.

How to Change the background Colour of Button.

Scheduled Pinned Locked Moved ASP.NET
csharpjavaasp-nettoolstutorial
4 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.
  • B Offline
    B Offline
    Binod K
    wrote on last edited by
    #1

    Hello All, I want to change the background colour of button, when user hover the mouse on it. I didnt find any such event in ASP.Net or in Code behind. I tested Java Script function as well, it recognize the onmouseover event and i am calling function there. But what would be the exact statement to change the colour. Anyone having idea or something ready. yours reply would be highly appreciated. Thanks.

    C S A 3 Replies Last reply
    0
    • B Binod K

      Hello All, I want to change the background colour of button, when user hover the mouse on it. I didnt find any such event in ASP.Net or in Code behind. I tested Java Script function as well, it recognize the onmouseover event and i am calling function there. But what would be the exact statement to change the colour. Anyone having idea or something ready. yours reply would be highly appreciated. Thanks.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You can do this with CSS, that's probably best.

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      • B Binod K

        Hello All, I want to change the background colour of button, when user hover the mouse on it. I didnt find any such event in ASP.Net or in Code behind. I tested Java Script function as well, it recognize the onmouseover event and i am calling function there. But what would be the exact statement to change the colour. Anyone having idea or something ready. yours reply would be highly appreciated. Thanks.

        S Offline
        S Offline
        Sathesh Sakthivel
        wrote on last edited by
        #3

        Use CSS instead of Javascript as CG said.

        SSK. Anyone who says sunshine brings happiness has never danced in the rain.

        1 Reply Last reply
        0
        • B Binod K

          Hello All, I want to change the background colour of button, when user hover the mouse on it. I didnt find any such event in ASP.Net or in Code behind. I tested Java Script function as well, it recognize the onmouseover event and i am calling function there. But what would be the exact statement to change the colour. Anyone having idea or something ready. yours reply would be highly appreciated. Thanks.

          A Offline
          A Offline
          Amol M Vaidya
          wrote on last edited by
          #4

          onmouseover = "this.style.backgroundColor = 'red';" remember to set it back to what it was else it will stay red :) Regards

          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