473,396 Members | 2,018 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,396 software developers and data experts.

changing asp:button text on rollover

using ASP.NET/VB.NET 2.0

I can change the text color of an ASP Button object on mouse
rollover/rollout by doing this (in page_load)

btnMyButton.Attributes.Add("onmouseover", "this.style.color='Yellow'")
btnMyButton.Attributes.Add("onmouseout", "this.style.color='White'")

But how can I change the text on rollover? I don't understand the javascript
DOM enough to know what to do. I did try:

btnMyButton.Attributes.Add("onmouseover", "this.text='My New Text'")

And Tried

btnMyButton.Attributes.Add("onmouseover", "this.style.text='My New Text'")

Of course, none of these do anything.

TIA,
Jim
Jul 23 '08 #1
1 2268
Hi,,,,

asp.net button eventually turned in to html input when rendered to
browser...
just add simple java script to change the value of the button on mouse
over and out...

btnMyButton.Attributes.Add("onmouseover", "myfunction()'")

in page write a javascript...

function myfunction()
{
document.getelementbyid(''<%#=btnMybutton.clientid %>).value =
"somevalue";
}
BEST OF LUCK

--------------
Munna

www.munna.shatkotha.com/blog
www.munna.shatkotha.com
www.shatkotha.com
Jul 23 '08 #2

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

Similar topics

0
by: Maziar Aflatoun | last post by:
Hi everyone, I have the following shopping cart (basket view). However, Delete button in my datagrid doesn't fire any events. Does anyone know why? (It's a user web control) <%@ Control...
2
by: Prisy | last post by:
Is it possible to have the text of the first-letter in an <asp:button> underlined? I was able to do the following to get the first letter underlined: <STYLE type="text/css">...
4
by: z. f. | last post by:
Hi, I'm having an aspx page with a server form. i have a grid with a delete button and below the grid, another area with inputs for inserting new values and an "add" button for submiting the...
1
by: RUIZCJ | last post by:
Hi, I'm at my wits end!!! I have the following code. The submit button works on my home computer but when I copy the dll and the ASPX file to my host provider, the button does NOT fire. TIA...
8
by: tatemononai | last post by:
I had a beautiful script that was running, well, just beautifully. But then I decided to take a button that fired an event and place it inside a <asp:table. The event WILL NOT FIRE INSIDE THE...
1
by: R.A.M. | last post by:
Hello, I have very simple problem which I present here second time, because I haven't got a solution. I need to process asp:Button click at server. I have written (my experience is little) in...
5
by: Doogie | last post by:
Hi, I am trying to access the visible property of an ASP button inside javascript to no avail. Here's what my button control looks like: <asp:Button id="btnAcceptTrips" name="btnAcceptTrips"...
4
by: Sean | last post by:
I have a situation whereby I need to modify the text string appearing on an ASP button with some text derived from a Javascript function. But I am unsure of the correct syntax to do so. ...
1
by: mazdotnet | last post by:
Hi all, I'm really stuck trying to figure the following out. I have been working on a shopping portal where you can select products from a list inside a repeater on the bottom of the page and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
0
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...
0
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...

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.