473,509 Members | 3,075 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Class not working for linkbutton

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
3 6192
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1447
by: Robert Harty | last post by:
Hello all, I have a strange problem with a HtmlTable control, which is dynamically created based on the results of a query. Each row in the table has a LinkButton added to it. When I create...
0
901
by: ElanKathir | last post by:
Hi All ! Here by attached two type's of Code, One -> ASP Controls Tag Code Another -> Server side Script of the page. The Server Side Script have Two Class
3
2675
by: tshad | last post by:
I have the following: <tr valign="baseline"> <td align="center" width="103" colspan=2 nowrap> <asp:Button ID="ViewPositions" runat="server" Text="View Positions" OnClick="ViewPositions_Click"...
5
3043
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
6
14432
by: Mark Olbert | last post by:
The doPostBack javascript functioning is not submitting the page when called by linkbuttons (or an autopostback checkbox, for that matter). I'm aware of a problem with Netscape browsers and the...
9
2678
by: Max Weebler | last post by:
Hi, I have a datagrid built that has an alternating item style that sets the backcolor and ForeColor of its rows. I have 4 template columns. One of them has a LinkButton embedded in it to...
3
6995
by: John | last post by:
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...
2
1658
by: tshad | last post by:
I am having a problem with my Datagrid that displays my Files via GetFiles() If I use a HyperLinkColumn - I can use the column name "Name" which is what the result from GetFiles(). ...
15
2032
by: Nathan Sokalski | last post by:
I have a section of my code that dynamically creates LinkButtons to allow the user to go to the page containing a question they have not answered. The code that creates the LinkButton is called, as...
0
7234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3216
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.