change the color of link button on mouseover event

2 views
Skip to first unread message

Er. Manish Insan

unread,
Dec 30, 2010, 3:42:46 AM12/30/10
to DotNetProfessionals-Group
-----------------------------------------------------write this script
in head part---------------------------------------------------

<script type ="text/javascript" >


function over()
{
document.getElementById('<%=LinkButton1.ClientID
%>').style.color = "blue";
//LinkButton1 is id of link button.
change it according to your button id.

}
function out()
{
document.getElementById('<%=LinkButton1.ClientID
%>').style.color = "red";
//LinkButton1 is id of link button.
change it according to your button id.

}
</script>

----------------------------------------write In the body tag where
linkbutton is placed----------------------------------------


<asp:LinkButton ID="LinkButton1" runat="server" onmouseover="over()"
onmouseout="out()" />


---------------------same we can use for many more events..........
Reply all
Reply to author
Forward
0 new messages