Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > HyperLinkField CssClass not working

Thread Tools

HyperLinkField CssClass not working

Posts: n/a
I am creating the content for my Gridview through code. My last column is a
hyperlinkfield. Everything is working fine except for applying my CssClass
to the HyperLinkField. I have tried the following:

hyperlinkfield.ControlStyle.CssClass = "MyClass"

However, this generates no html output to the page and the style is not
applied. If I set the code using the ItemStyle instead of controlStyle, it
gets applied to the <td> tag. I need to have the style applied to the
hyperlink. Any thoughts on why I do not see code when I set the controlStyle?
Reply With Quote

Thread Tools

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
GridView working with External Stylesheet and CssClass JB ASP .Net 2 10-03-2009 06:57 PM
hyperlinkfield does not render hyperlink in gridview Carlos ASP .Net 0 08-26-2009 08:43 PM
HyperLinkField Help Bruno Alexandre ASP .Net 1 12-06-2004 02:01 PM
CssClass not working in code behind Max ASP .Net 1 01-03-2004 07:58 PM
CssClass property not working Dales ASP .Net Building Controls 1 11-19-2003 09:38 PM