Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help with ASP.NET Label Control

Status
Not open for further replies.

Cheryl73

Programmer
Aug 16, 2004
9
0
0
US
I have a simple label control that I need to display in a ASP.NET application and I need to get the label to display in a red colored font. I have tried the following code several times and the text of the label will not change to red, it still displays as black text: (The code is within a table tag.)

<td class="fieldName"><asp:label id="lblTtlManHrs" runat="server" ForeColor="#CC0000">Total Man Hours: </asp:label>

Some one else programmed the application that I'm working with in ASP.NET. I just just changed the .aspx web page on in notepad and then just did a copy and replace but the code did not work.

Do I need to reboot either just IIS or reboot the server that this application is located on to get the change in code (I added the ForeColor attribute.) to work and turn the text Total Man Hours to red?

Any assistance would be greatly appreciated.
 

Shouldn't need to restart IIS. It may be a case of a cached page in your browser. Try viewing the page and press F5...


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Press ctrl + F5 will refresh without and not use the cached version.
 
Hi Guys:

I have tried refreshing the page in the browser as you have stated. Using CTRL + F5, but the text color stayed black.

Any other suggestions?

Thanks for the advice about the cached web pages.
 
there is a class on the the containing <td>, however, your ForeColor would override any color attribute in there. The last thing to check is in any CSS file that colors spans. The label control renders as a span, so if there is a general css element it will color it. For example(in a css file or css somewhere in the page)
Code:
#span{
   color: black;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top