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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. asp:button MouseOver

asp:button MouseOver

Scheduled Pinned Locked Moved ASP.NET
tutorialjavacsshardwarequestion
4 Posts 2 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.
  • D Offline
    D Offline
    Drathmar
    wrote on last edited by
    #1

    I'm having problems finding the best way to set the mouse over attribute for several buttons. right now I do something like : btnClear.Attributes.Add('onMouseOut', 'setStyleOff(this.id)); and I do this in the page load for each button, a mouse over and a mouse out event However this can get quite tedious when you want all your buttons to have the same effect and some of them are embedded in datalists or grids. Is it possible to set the mouse over/out event in a skin file or a CSS style sheet so that it will run the same java function for EVERY button on a page? If so, could someone give an example of how to do this? Kris

    M 1 Reply Last reply
    0
    • D Drathmar

      I'm having problems finding the best way to set the mouse over attribute for several buttons. right now I do something like : btnClear.Attributes.Add('onMouseOut', 'setStyleOff(this.id)); and I do this in the page load for each button, a mouse over and a mouse out event However this can get quite tedious when you want all your buttons to have the same effect and some of them are embedded in datalists or grids. Is it possible to set the mouse over/out event in a skin file or a CSS style sheet so that it will run the same java function for EVERY button on a page? If so, could someone give an example of how to do this? Kris

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      IMO, you'll have at least two options here: + Use the skin file to define the client side mouse events for the server button control. + It's a good candidate to develop a custom button control which by defalt has the mouse event handlers defined.

      D 1 Reply Last reply
      0
      • M minhpc_bk

        IMO, you'll have at least two options here: + Use the skin file to define the client side mouse events for the server button control. + It's a good candidate to develop a custom button control which by defalt has the mouse event handlers defined.

        D Offline
        D Offline
        Drathmar
        wrote on last edited by
        #3

        Could you give me an example on the syntax to add a mouse over event to a button in a skin file? The only way I know how to do this is code file for a given page.

        M 1 Reply Last reply
        0
        • D Drathmar

          Could you give me an example on the syntax to add a mouse over event to a button in a skin file? The only way I know how to do this is code file for a given page.

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          In a skin file, you simply declare the button:

          <asp:button on_mouseover="yourclientsidefunction();" ..../>

          then in the Page directive, you can simply set the theme for the web page. The settings of the button in the skin file of the specified theme will be applied to all the buttons on the web page.

          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