You may have noticed that the color of the validation text is black in framework 4.0. To make it red again I found the following solution but some users say that it doesn’t work always.
<?xml version=”1.0″?>
<configuration>
<system.web>
<compilation debug=”false” targetFramework=”4.0” />
<pages controlRenderingCompatibilityVersion=”3.5″ />
</system.web>
</configuration>
Therefore, I was looking for a different solution and I found it; I am adding the followings in my skin file and they work fine for me
<asp:RangeValidator runat=“server” ForeColor= “Red” />
<asp:CustomValidator runat=“server” ForeColor= “Red” />
<asp:RequiredFieldValidator runat=“server” ForeColor= “Red” />
<asp:CompareValidator runat=“server” ForeColor= “Red” />
<asp:RegularExpressionValidator runat=“server” ForeColor= “Red” />
<asp:ValidationSummary runat=“server” ForeColor= “Red” />
Also, you can create a class in CSS style sheet and use that in every validation control but I liked the skin file solution better because you just write once and you are done; simple…
0 Comments