Possible to have non-image based rollover buttons?

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

Using ASP.NET, is this possible? All I want is something simple, like
bold-facing the text.
An alternative would be to use plain text links (IE 6.0, so we can rely
on CSS and the anchor hover).

Maybe there's a 3rd party control out there that does this? Possible
to make your own? Thoughts? Thanks.
 
Hi Doug,

There's lots you can do with dynamic HTML on regular buttons. You just need
to change the styles. See the sample below.

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]



<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
Button1.Attributes.Add _
("onmouseover", "this.style.fontWeight='bold'")
Button1.Attributes.Add _
("onmouseout", "style.fontWeight='normal';" & _
"this.style.backgroundColor='white'")
End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Change button</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:button id="Button1" runat="server" text="Hover over me!"
/></div>
</form>
</body>
</html>
 
Worked like a charm. Thanks.

Sorry it took so long to reply.

Please reply if you see this. I'm curious to see if people read these
things if there is no activity for a day or two. Or sixteen. ;-)
 

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

Back
Top