ASP - Conditional formatting?

Soldato
Joined
4 Nov 2007
Posts
4,514
Morning all.

Just a quick one, can't find much on google and in need of a quick-fix.

How can I make a column in a table on an ASP page go red when the value is less than 6.5?

Here's the asp file - http://rafb.net/p/bzRFdB24.html

I didn't write the page and it's not been annotated so haven't clue where the tables are. Assuming it's just a small bit of code, but don't know where! TIA
 
the table writing is here, but simple it's not.
Code:
' Show NoRecords block if no records are found
            If Recordset.EOF Then
                TemplateBlock.Block("NoRecords").Parse ccsParseOverwrite
            End If
            While NOT Recordset.EOF AND ShownRecords < PageSize
                scorea.Value = 0
                scoreb.Value = 0
                scorec.Value = 0
                scored.Value = 0
                scoree.Value = 0
                scoref.Value = 0
                average.Value = 0
                contname.Value = Recordset.Fields("contname")
                subcon.Value = Recordset.Fields("subcon")
                service.Value = Recordset.Fields("service")
                scorea.Value = Recordset.Fields("scorea")
                scoreb.Value = Recordset.Fields("scoreb")
                scorec.Value = Recordset.Fields("scorec")
                scored.Value = Recordset.Fields("scored")
                scoree.Value = Recordset.Fields("scoree")
                scoref.Value = Recordset.Fields("scoref")
 
                CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowRow", Me)
                RowControls.Show
                Recordset.MoveNext
                ShownRecords = ShownRecords + 1
            Wend

Can't see the rest of the linked pages and controls so don't know what you should do to make it change the cell (scorea) background colour.
CCRaiseEvent(CCSEvents, "BeforeShowRow", Me) probably does the writing to the page.
 
There's a default.html in there as well. Table code;

Code:
<tr>
    <td class="NoiseDataTD"><font face="Arial Narrow" size="1">{contname}&nbsp;</font></td> 
    <td class="NoiseDataTD"><font face="Arial Narrow" size="1">{subcon}&nbsp;</font></td> 
    <td class="NoiseDataTD"><font face="Arial Narrow" size="1">{service}&nbsp;</font></td> 
    <td class="NoiseDataTD"><font face="Arial Narrow" size="1">{scorea}&nbsp;</font></td> 
    <td class="NoiseDataTD"><font face="Arial Narrow" size="1">{scoreb}&nbsp;</font></td> 
    <td class="NoiseDataTD"><font face="Arial Narrow" size="1">{scorec}&nbsp;</font></td> 
    <td class="NoiseDataTD"><font face="Arial Narrow" size="1">{scored}&nbsp;</font></td> 
    <td class="NoiseDataTD"><font face="Arial Narrow" size="1">{scoree}&nbsp;</font></td> 
    <td class="NoiseDataTD"><font face="Arial Narrow" size="1">{scoref}&nbsp;</font></td> 
    <td class="NoiseDataTD">{average}</td> 
  </tr>
 
Well scoref is a cssLabel created by CCCreateControl(ccsLabel.....
so you may be able to alter it's css properties and change the color to red.
You'll have to find out what CCCreateControl does.

If the default.html was an asp page you'd be laughing
Code:
<td class="NoiseDataTD" <% if ({scoree} < 6.5) then response.write("style='color:red') end if %> ><font face="Arial Narrow" size="1">{scoree}&nbsp;</font></td>
 
It's actually in a web-part in sharepoint.

The web-part is pointing at default.asp, I can alter the format of the text in the html page, so they're linked some-how.

Any way to get that piece of code working by changing the html to an asp page?
 
Can't anyone tell me what language the {scoreb} is in? I've worked with SQl using asp before but have never seen {variable} before, I can atelast have a crack at working with the variable if I knew the language.

<td class="NoiseDataTD"><font face="Arial Narrow" size="1">{scoref}&nbsp;</font></td>

Help!
 
I would suggest CCRaiseEvent(CCSEvents, "BeforeShowRow", Me) deals with replaceing the {var} in the html stream or something in there.

I would think it's just a placeholder.
 
Back
Top Bottom