Class not working for linkbutton

T

tshad

I have a page where I want to set my linkbutton text using a class and
cannot seem to get it to work using CSSClass, but it works fine using
"ForeColor".

Why is that?

Here is the code:
**************************************************
<%@ Page Language="VB" trace="false" debug="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<Script runat="server">
sub newLogonClick(sender as Object,e as EventArgs)

end sub
</Script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Logon</title>
</head>
<style type="text/css">
..linkButton a:visited {color:#00FF33;font-weight:bold;
}
..linkButton a:link {color:#00FF33;font-weight:bold;
}
..linkButton a:active {color:#00FF33;font-weight:bold;
}
</style>
<body>
<!-- Content Starts Here -->
<form id="Form1" runat="server">
<asp:LinkButton id="newLogon" CSSClass="linkButton" onClick="newLogonClick"
Text="Register Now" runat="server" /><br>
<asp:LinkButton id="newLogon2" ForeColor="#00FF33" onClick="newLogonClick"
Text="Register Later" runat="server" />
</form>
</body>
</html>
***************************************************************************************

I am just setting 2 links, one set with a class and one set directly.

MS says you can using CSSClass, but it doesn't seem to work.

Thanks,

Tom
 
P

Patrick Olurotimi Ige

Tom..

<asp:LinkButton id="newLogon" CSSClass="linkButton"
onClick="newLogonClick"
Text="Register Now" runat="server" /><br>

Your LinkButton above should work for you!

How are you creating your Style sheet for linkbutton?

<style>
..linkbutton { FONT-WEIGHT: bold; FONT-SIZE: 7pt; TEXT-TRANSFORM:
capitalize; COLOR: white; FONT-FAMILY: Verdana; BACKGROUND-COLOR:
#7da1e9 }
</style>

Try using that and see if it works!

Hope it helps
Patrick
 
D

David Jessee

I had to stare at this for a second. Your asp is fine....the style is
messed up :)

a.linkButton:visited {color:#00FF33;font-weight:bold;
}
a.linkButton:link {color:#00FF33;font-weight:bold;
}
a.linkButton:active {color:#00FF33;font-weight:bold;
}
 
T

tshad

David Jessee said:
I had to stare at this for a second. Your asp is fine....the style is
messed up :)

a.linkButton:visited {color:#00FF33;font-weight:bold;
}
a.linkButton:link {color:#00FF33;font-weight:bold;
}
a.linkButton:active {color:#00FF33;font-weight:bold;
}

That seems to be it.

I don't know why I thought the other format would work. I saw it somewhere.

Thanks,

Tom
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top