473,748 Members | 2,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Att ributes.Add("on mouseover", "this.style.col or='Yellow'")
btnMyButton.Att ributes.Add("on mouseout", "this.style.col or='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.Att ributes.Add("on mouseover", "this.text= 'My New Text'")

And Tried

btnMyButton.Att ributes.Add("on mouseover", "this.style.tex t='My New Text'")

Of course, none of these do anything.

TIA,
Jim
Jul 23 '08 #1
1 2293
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.Att ributes.Add("on mouseover", "myfunction()'" )

in page write a javascript...

function myfunction()
{
document.getele mentbyid(''<%#= btnMybutton.cli entid %>).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
1578
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 Language="c#" AutoEventWireup="false" Codebehind="ShoppingCart.ascx.cs" Inherits="TPShoppingCart.ShoppingCart1" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%> <asp:datagrid id="DGShoppingCart" AutoGenerateColumns="False" Width="650"
2
5016
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"> BUTTON:first-letter { TEXT-DECORATION: underline } </STYLE> <button id="btnTest" accesskey="T" runat="server" type="button" value="Test" Test</button>
4
2286
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 lower area of the form. on the lower area i have validators for validating input.
1
3632
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 RuizCJ
8
3891
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 TABLE!?! When I move the button outside the table, it works just fine. Inside the table, it doesn't. What gives?
1
1609
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 .aspx: <asp:Button ID="GoTo" runat="server" Text="Go To" OnClick="GoTo_Click" /> and in .aspx.cs I have written with Visual Studio:
5
16306
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" runat="server" Text="Accept Trips" Visible="False"> Here's my test method: function test(checkbox)
4
2018
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. Currently the I am just modifying the text in a SPAN next to the button as opposed to change the button text itself. But it's not ideal really. Currently I am have this: <div id="section2">
1
4918
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 on each row, once clicked you can enter a quantity and add it to your cart automatically on top (using UpdatePanel). Everything seems to be working fine when I created a dummy DataTable and did a bind but now that I'm actually reading the contents...
0
8995
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
8832
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9558
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9378
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...
0
6077
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
4608
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...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2216
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.