By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,190 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,190 IT Pros & Developers. It's quick & easy.

Class not working for linkbutton

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #2

P: n/a
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;
}
"tshad" <ts**********@ftsolutions.com> wrote in message
news:uY*************@TK2MSFTNGP09.phx.gbl...
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

Nov 19 '05 #3

P: n/a
"David Jessee" <dj*****@houston.rr.com> wrote in message
news:ut**************@tk2msftngp13.phx.gbl...
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

"tshad" <ts**********@ftsolutions.com> wrote in message
news:uY*************@TK2MSFTNGP09.phx.gbl...
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


Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.