Hover button

  • Thread starter Thread starter Brad
  • Start date Start date
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
 
You would need to do this via a client-side JavaScript since mouseOver is an
event triggered at the client level.
 
Thanks for the information.

So the button objects I am using should be html buttons and not ASP objects.
 
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
 
for a webserver control it would be
button1.attributes.add("onmouseover","somejavascriptfunctionhere()");
 
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
 
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
 
Back
Top