473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Change background image of asp:button

I know I can use <a></aand 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

Jan 8 '07 #1
4 22075
"Israel Richner" <is************@gmail.comwrote in message
news:11**********************@11g2000cwr.googlegro ups.com...
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.
Sounds like you need a combination of a button and a hyperlink - luckily,
Microsoft have provided one for you:
http://msdn2.microsoft.com/en-us/lib...inkbutton.aspx
Jan 8 '07 #2
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

Mark Rae wrote:
"Israel Richner" <is************@gmail.comwrote in message
news:11**********************@11g2000cwr.googlegro ups.com...
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.

Sounds like you need a combination of a button and a hyperlink - luckily,
Microsoft have provided one for you:
http://msdn2.microsoft.com/en-us/lib...inkbutton.aspx
Jan 8 '07 #3
"Israel Richner" <is************@gmail.comwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
Will I still use

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

...in order to change the background image when the user hovers over
the link?
Well, have you tried it...? ;-)
Jan 8 '07 #4
I guess I should have before I asked.....it works great!

Thanks Mark,
Iz

Mark Rae wrote:
"Israel Richner" <is************@gmail.comwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
Will I still use

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

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

Well, have you tried it...? ;-)
Jan 8 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Russell | last post by:
I have a web page that i am using an image button as my submit button. The code behind the button works, but when I click enter on the web page, nothing happens. Can anybody tell me how to get my...
1
by: Miguel Dias Moura | last post by:
Hello, On na ASP.NET/VB web page i have a form and i have this button: <asp:Button ID="search" runat="server" OnClick="searchGO" Text="search" /> I want to use the image search.gif instead of...
4
by: rkbnair | last post by:
Is there any way to display an image button instead of the traditional Edit/Update/Cancel push button in a datagrid (with bound data)?
2
by: pmud | last post by:
Hi, I am designing a simple ASP.NET web page. I have an image button. What I want to do is: when the cursor is over the image button, a drop down meny should display. This menu should have tabs...
0
by: R.A.M. | last post by:
Hi, I need your help with login implementation in my ASP.NET 2.0 demo application. I have custom login control on my default.aspx page: .... <form id="LoginForm" runat="server" method="post"...
1
by: Phil_Cam | last post by:
Hello All On a webpage I have a standard paypal image button for purchases. I am trying to set it up so that it only shows up or is endabled when text is entered into a textbox and a button is...
0
by: Italian Pete | last post by:
Hi, I have a c# asp.net web form which contains a User Control search bar composed of a text box and a search button (asp:ImageButton) In classic asp, I would have had the search bar as a...
3
by: glbdev | last post by:
Hi. I have a gridview in which each row has an image button attached. I have each button in each row set up to be associated with a DB field. When I hover above the button it shows me the...
4
by: glbdev | last post by:
Hi, I posted this question yesterday but didn't get the answer I needed. I am DESPERATE to get this working so I'm re-posting it because I don't think I worded it correctly. I have a GridView...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.