How to set the css of a hyperlink in a dataList

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sheena777
    New Member
    • Dec 2007
    • 73

    How to set the css of a hyperlink in a dataList

    I have a datalist that I am using to store a list of hyperlinks.The items for the data list gets added dynamically when the web page is loaded. My problem now come to setting the text color of the HyperLink. How can i set the colour of the Hyper link that is located in the datalist. I know how to set the background color of the datalist Item but this is not what I need to do. This also has to be dynamic because this will change depending on certain conditions that need to be met. Thanks in advance:)
  • dmj07
    New Member
    • Aug 2008
    • 55

    #2
    Hope this can help you. In code behind:

    HyperLink hyp = (HyperLink)Data List1.FindContr ol("Hyperlink1" );
    hyp.CssClass = //if you want to change the css class
    hyp.ForeColor = //to change font color

    Comment

    Working...