title: How to set link color inside GridView cell
body: <p>ASP.net:</p>
  
  <pre><code>&lt;asp:HyperLinkField DataNavigateUrlFields="carrier_id,carrier_plan_id,card_id" HeaderText="Health Plan" 
           HeaderStyle-CssClass="subNav" HeaderStyle-HorizontalAlign="Center" SortExpression="health_plan" HeaderStyle-BackColor="#CCCCCC"
           DataNavigateUrlFormatString="somewhereA.aspx?cid={0}&amp;cpid={1}&amp;ccid={2}" DataTextField="health_plan_title"
           NavigateUrl="somewhereA.aspx" ItemStyle-Font-Bold="True"&gt;
              &lt;HeaderStyle CssClass="infoBoldBlueSmall"&gt;&lt;/HeaderStyle&gt;
       &lt;/asp:HyperLinkField&gt;
  </code></pre>
  
  <p>By default the link color is what is driven by the browser standard but I have a condition, if met I would like the link color to change, which is done in code-behind:</p>
  
  <pre><code>If IsDBNull(e.Row.DataItem("isRed")) = False Then
      If (e.Row.DataItem("isRed") = "N") Then 'AND (lnk.NavigateUrl Is Nothing) Then
          e.Row.Cells(1).ForeColor = Drawing.Color.Red //hyperlink (which doesn't work because it is only setting the cell color)
          e.Row.Cells(1).CssClass = "redColor" //hyperlink (which also doesn't work because it is being overridden by browser)
      End If
  End If
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>.redColor
  {
      color: #FF0000 !important;
  }
  </code></pre>
  
  <p>Output in browser:</p>
  
  <pre><code>&lt;td class="redColor" style="color: red; font-weight: bold;"&gt;&lt;a href="somewhereA.aspx?cid=90000&amp;amp;cpid=12&amp;amp;ccid=56"&gt;This should be red&lt;/a&gt;&lt;/td&gt;
  </code></pre>
  
  <p>It is setting the TD in red but not the link itself.</p>
  
  <p>How can I modify my VB.net code which will set the link class to <code>redColor</code> if the condition is met.</p>