CSS class attribute removed in rendered HTML

I am try to apply a CSS class to an anchor element in an ascx control, however when the HTML is rendered the class attribute is removed. I am using IE 7.0. No clue as to why it is doin this.
In code: <a href="UpdateContact.aspx" class="alertMessage"><u>here</u></a> 
 
in browser-source: <a href="UpdateContact.aspx"><u>here</u></a>
 
CSS class
.alertMessage
{
 color: #660000;
}

Open in new window

LVMinerAsked:
Who is Participating?
 
aibusinesssolutionsCommented:
With the asp:Hyperlink, format it like so.

<asp:HyperLink runat="server" CssClass="alertMessage" NavigateUrl="updatecontacts.aspx"><u>Here</u></asp:HyperLink>
0
 
aibusinesssolutionsCommented:
Hmm, that could be a couple different things.

If you are using a the built in local web server, it may be stuck caching an older page, you can right click it in your system tray and stop it then browse to it again.  For IIS just do an iisreset from Start>Run.

If not, does the <a> tag have a runat="server" tag?  Is that the exact code pasted from your code?

Are you using an asp:HyperLink?
0
 
LVMinerAuthor Commented:
Tried resetting local IIS and emptying IE 7 web cache files with negative results. The code is exact as pasted. Going to try the asp:Hyperlink to see if this is a solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.