J
John
Hi
I have been trying to change the css class of a linkbutton without succes
( I dont want to change the cssclass property). Maybe somebody knowshow to
do this?? th.John
<%@ 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)
Me.LinkButton1.Attributes.Add("onclick", "javascript:change('LinkButton1',
'first');")
End Sub
</script>
<style type="text/css">
..first
{
color: black;
}
..second
{
color: red;
}
</style>
<script language="JavaScript">
function change(id, newClass) {
identity=document.getElementById(id);
identity.className=newClass;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:LinkButton ID="LinkButton1" class="second"
runat="server">LinkButton</asp:LinkButton></div>
</form>
</body>
</html>
I have been trying to change the css class of a linkbutton without succes
( I dont want to change the cssclass property). Maybe somebody knowshow to
do this?? th.John
<%@ 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)
Me.LinkButton1.Attributes.Add("onclick", "javascript:change('LinkButton1',
'first');")
End Sub
</script>
<style type="text/css">
..first
{
color: black;
}
..second
{
color: red;
}
</style>
<script language="JavaScript">
function change(id, newClass) {
identity=document.getElementById(id);
identity.className=newClass;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:LinkButton ID="LinkButton1" class="second"
runat="server">LinkButton</asp:LinkButton></div>
</form>
</body>
</html>