473,665 Members | 2,827 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 22086
"Israel Richner" <is************ @gmail.comwrote in message
news:11******** **************@ 11g2000cwr.goog legroups.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.goog legroups.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.goo glegroups.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.goo glegroups.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
5438
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 image button to act as the default button on the form? Thanks in advance Russell
1
1364
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 the standard button. How can I do this? Thanks,
4
6941
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
2071
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 which are images. What can be the C# code for this. Please help. Thanks
0
1140
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" action="Welcome.aspx" style="vertical-align: middle;"> <asp:ImageButton ID="DotNETImage" runat="server"
1
6126
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 pressed. To do this I set the type to hidden and changed the type of the button using javascipt to image. This works perfectly in Modilla's Firefox but in IE it says there is a scipt error. Here is the javascipt
0
1116
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 separate form which would allow me to hit the return key after inputting some text in the text box and the search form would be submitted. However, now I have the situation that if I click on the Image button, the web form is submitted and the Search...
3
4515
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 correct value of the DB field in a tooltip, so there is no problem there. But ...how do I access that value? When the user clicks that button I will redirect him to a new page and I need to use the value as an ID in a querystring, but cannot figure...
4
3669
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 which is databound to a table. All the data is being pulled correctly so there is no problem there. On each row I have an image button which is attached to a
0
8438
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8779
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7376
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6187
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4186
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2765
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 we have to send another system

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.