Change background image of asp:button

Discussion in 'ASP .Net' started by Israel Richner, Jan 8, 2007.

  1. I know I can use <a></a> and modify it's :hover and :visited appearance
    in my .css file. I'd like to know if I can do the same for a asp:button
    control.

    I'd like to do some processing of data in the on click event for the
    asp:button control and I would like to be able to control it's
    "visited" and "hover" appearance.

    Using a hyperlink I would just write this in the .css file

    a:hover
    {
    blah blah;}

    a:visited
    {
    blah blah;}

    Can I do the same for an asp:button? If so how?

    I've tried using the asp:hyperlink but it does not have an on click
    event in the code behind page.

    I'm somewhat new to web programming so if there is a better approach to
    this issue please let me know.

    Thanks,
    Iz
     
    Israel Richner, Jan 8, 2007
    #1
    1. Advertisements

  2. Israel Richner

    Mark Rae Guest

    Mark Rae, Jan 8, 2007
    #2
    1. Advertisements

  3. Thanks Mark that looks like the control I'm looking for.

    Will I still use

    a:hover
    {
    background-image: url("somepath");}

    ....in order to change the background image when the user hovers over
    the link?

    Iz
     
    Israel Richner, Jan 8, 2007
    #3
  4. Israel Richner

    Mark Rae Guest

    Well, have you tried it...? ;-)
     
    Mark Rae, Jan 8, 2007
    #4
  5. I guess I should have before I asked.....it works great!

    Thanks Mark,
    Iz
     
    Israel Richner, Jan 8, 2007
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.