0

In my web page there is link button and on that link button i want to add pseudo class of css which is made in another css page. I call that css page in aspx page. I want to use my pseudo class with this linkbutton .How to use this?

So my question is :I want to add this pseudo cssclass in linkbutton. how to do that?

This css want to call on linkbutton.

<style type="text/css">
lbtnLogOut:link {color:red;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;}   
lbtnLogOut:visited {color:#598090;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;} 
lbtnLogOut:hover {color:green;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;} 
lbtnLogOut:active {color:Fuchsia;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;}
</style>

On this link button i want to use.

<asp:LinkButton ID="lbtnLogOut" runat="server" OnClick="lbtnLogOut_Click" cssClass="lbtnLogOut"
          CausesValidation="False" OnClientClick="return ValidateTextBox();">Log Out</asp:LinkButton> 

This is not working .please someone modify it.

3
  • 1
    And what exactly is the issues you are having? You gave a description of what you want, but did not actually described a problem or asked a question. Commented Oct 11, 2010 at 9:04
  • @Oded:i want to add above pseudo cssclass in linkbutton. how to do that? Commented Oct 11, 2010 at 9:13
  • You can edit your question and add this detail to it. Many people don't read the comments, so it is always better to update the question with any needed detail. Can you please also tell us what you did try and what didn't work? Commented Oct 11, 2010 at 9:16

2 Answers 2

1

CSS class names are preceded by dot(.) in style-sheet. So you need to modify CSS section:

<style type="text/css">
   .lbtnLogOut:link {color:red;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;}   
   .lbtnLogOut:visited {color:#598090;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;} 
   .lbtnLogOut:hover {color:green;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;} 
   .lbtnLogOut:active {color:Fuchsia;font-size: 12px;font-family: Verdana, Arial;font-size: 12px;}
</style>

Another thing - check case of CssClass property (you have used cssClass).

Sign up to request clarification or add additional context in comments.

Comments

1

Just to clarify what i think you are trying to say:

you have a css class that you want to add to an asp:Linkbutton if so then there is an attribute called Cssclass and you can use that to point to a cssclass

<asp:LinkButton CssClass="classnamehere" />

hopefully that helps

paul

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.