473,508 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 22081
"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
5430
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
1356
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
6935
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
2064
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
1138
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
6112
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
1112
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
4503
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
3663
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
7223
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
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.