PC Review


Reply
Thread Tools Rate Thread

asp:LinkButton and CssClass

 
 
Alex
Guest
Posts: n/a
 
      25th Aug 2008
I have an asp linkbutton declared as follows:
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="tt">ASP Link
Button</asp:LinkButton>

My CSS classes are declared as follows:
a.tt
{
color:Black;
text-decoration: none;
border-bottom: 1px dashed Blue;
}
a.tt:visited {
color: Black;
}

a.tt:hover
{
background:#F0F8FF;
color:Black;
cursor:help;
}

But when I run the page, none of the a.tt styles are being displayed. The
strange thing is, when I add a regular html <a> control on the page, it works
fine.
 
Reply With Quote
 
 
 
 
David Wier
Guest
Posts: n/a
 
      25th Aug 2008
that's odd - I just created a page with just the link button, copied from
your code below, and added a stylesheet with your css code - -
It seemed to work just fine - - at least the main class - - since I have no
code for it to go anywhere, I can't verify the 'visited' css


David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
http://cg.augustwind.com - ControlGrouper (new ASP.Net control) - control
multiple controls at one time.


"Alex" <(E-Mail Removed).(donotspam)> wrote in message
news:6EA6D8DE-82CD-4560-BA34-(E-Mail Removed)...
>I have an asp linkbutton declared as follows:
> <asp:LinkButton ID="LinkButton1" runat="server" CssClass="tt">ASP Link
> Button</asp:LinkButton>
>
> My CSS classes are declared as follows:
> a.tt
> {
> color:Black;
> text-decoration: none;
> border-bottom: 1px dashed Blue;
> }
> a.tt:visited {
> color: Black;
> }
>
> a.tt:hover
> {
> background:#F0F8FF;
> color:Black;
> cursor:help;
> }
>
> But when I run the page, none of the a.tt styles are being displayed. The
> strange thing is, when I add a regular html <a> control on the page, it
> works
> fine.



 
Reply With Quote
 
Alex
Guest
Posts: n/a
 
      26th Aug 2008
You're right. The code would have worked. I took a look at my aspx code and I
noticed I didn't have a close ">" in the DOCTYPE declaration. It's all good
now.

This is so strange. It's a very big page, with tabs and grids and every
control you can think of, and the only one that didn't work was the link
button....

"David Wier" wrote:

> that's odd - I just created a page with just the link button, copied from
> your code below, and added a stylesheet with your css code - -
> It seemed to work just fine - - at least the main class - - since I have no
> code for it to go anywhere, I can't verify the 'visited' css
>
>
> David Wier
> http://aspnet101.com
> http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
> bloated markup
> http://cg.augustwind.com - ControlGrouper (new ASP.Net control) - control
> multiple controls at one time.
>
>
> "Alex" <(E-Mail Removed).(donotspam)> wrote in message
> news:6EA6D8DE-82CD-4560-BA34-(E-Mail Removed)...
> >I have an asp linkbutton declared as follows:
> > <asp:LinkButton ID="LinkButton1" runat="server" CssClass="tt">ASP Link
> > Button</asp:LinkButton>
> >
> > My CSS classes are declared as follows:
> > a.tt
> > {
> > color:Black;
> > text-decoration: none;
> > border-bottom: 1px dashed Blue;
> > }
> > a.tt:visited {
> > color: Black;
> > }
> >
> > a.tt:hover
> > {
> > background:#F0F8FF;
> > color:Black;
> > cursor:help;
> > }
> >
> > But when I run the page, none of the a.tt styles are being displayed. The
> > strange thing is, when I add a regular html <a> control on the page, it
> > works
> > fine.

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LinkButton requires two UI clicks to change cssclass property HillBilly Microsoft C# .NET 1 17th Aug 2008 08:14 PM
Re: LinkButton requires two UI clicks to change cssclass property Göran Andersson Microsoft C# .NET 0 17th Aug 2008 07:50 AM
using cssclass with CSS IDs DamienS Microsoft ASP .NET 4 14th Jul 2008 03:22 AM
cssClass and ID same name rodchar Microsoft ASP .NET 2 31st Mar 2008 05:26 PM
CssClass shapper Microsoft ASP .NET 3 30th May 2007 12:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:19 AM.