Hover button

B

Brad

How can I declare a routine to occur when the mouse is "hovered" over a
certain button? I usually use Windows forms and I know how to there
(btn1_mouseover), but I do not see this in ASP. As you can tell, I am a new
one to ASP .NET.

Thanks for any information.

Brad
 
S

Scott M.

You would need to do this via a client-side JavaScript since mouseOver is an
event triggered at the client level.
 
B

Brad

Thanks for the information.

So the button objects I am using should be html buttons and not ASP objects.
 
H

Hermit Dave

well if you want a server side event handling them you will have to use the
button object and not html object.
but everything varies on client side.. so if you want things like hower then
you have to write additional javascript to do that
 
A

Alvin Bruney [ASP.NET MVP]

for a webserver control it would be
button1.attributes.add("onmouseover","somejavascriptfunctionhere()");
 
B

Brad

I see that I can add btn1.attributes.add("onmouseover", "this.style...") to
the page_init of the .aspx.cs page. Where is this file found? I am not
locating it.

Thanks again for the information.



Alvin Bruney said:
for a webserver control it would be
button1.attributes.add("onmouseover","somejavascriptfunctionhere()");

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Brad said:
Thanks for the information.

So the button objects I am using should be html buttons and not ASP objects.


is
over
am
 
S

Scott M.

What file are you not locating? The .cs file? If you are using VS.NET, the
the .cs file (called the "Code Behind" file) is usually hidden from the
Solution Explorer view, but the file exists in the same directory as your
..aspx pages. The class in the code behind file is compiled into your
assembly so that when you deploy, you only need to copy your .aspx pages and
your assembly (.dll) and a few other supporting files, but the .cs files
don't need to be copied to the production machine.


Brad said:
I see that I can add btn1.attributes.add("onmouseover", "this.style...") to
the page_init of the .aspx.cs page. Where is this file found? I am not
locating it.

Thanks again for the information.



Alvin Bruney said:
for a webserver control it would be
button1.attributes.add("onmouseover","somejavascriptfunctionhere()");

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Brad said:
Thanks for the information.

So the button objects I am using should be html buttons and not ASP objects.


You would need to do this via a client-side JavaScript since
mouseOver
is
an
event triggered at the client level.


How can I declare a routine to occur when the mouse is "hovered"
over
a
certain button? I usually use Windows forms and I know how to there
(btn1_mouseover), but I do not see this in ASP. As you can tell,
I
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top