Color of Validation Text

by | 10 Apr 2013

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

Submit a Comment

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

Other Posts

Visiting Parks

During this summer I started to take my kids to different parks, so they can spend some time outside of the house and get some physical movements rather than playing video games the whole day. I take pictures every time we go outside. Also, I make videos of less than...

Silly Talk

When he was learning to speak instead of saying I went there my eldest son, Mahir, used to say I goed there. Inspired by his innocent mistake I created two more words tolded and sawed. For example, I tolded you to go to bed but I sawed you playing instead later. Then...

AT&T Cheated Me

I complained many times against AT&T, still stayed with them because they gave me good prices for phones. This time they lied to me and I believe I won’t stay with them after my contract is over unless they give me what they promised. First, they sold me Samsung...

ভুল

ভুল বিশ্বাসঘাতকের মুখ দেখতে কেমন হয় আমি ঠিক জানি না কিন্তু কেন যেন মনে হয় দেখতে সুন্দরই হয়। এরা মিষ্টি মিষ্টি কথা বলে আবার মাঝে মাঝে বলে "আমি মিথ্যা বলি না"। বার বছর একসঙ্গে থাকলেও এদের চেনা যায় না আমার তো মনে হয় বারশ বছরেও চেনা যাবে না যদি না এরা নিজেদের স্বরূপ...

Neighborhood Nuisance

It was about 9:30pm on Saturday 17 December 2022, someone knocked our door hard – first I thought it was an Amazon delivery guy but didn’t see anyone or nothing was left on our doorstep. We checked the footage from our security camera and saw someone was running away...

মাততে পারেনি

যদিও শব্দটার অর্থ জানাছিল তবুও সিলেটী ভাইয়েরা যখন নিজেদের ভাষায় কথা বলেন তখন দুর্বোধ্য শোনায়। তাই যখন আমি আমার ছেলেকে আরবি পড়ার শেষে মসজিদ থেকে আনার সময় অন্য একজন অবিভাবক জিজ্ঞেস করলেন 'মাততে পারেনি' আমি বুঝতে পারিনি। দ্বিতীয়বার যখন বললেন 'ছেলে বাংলায় মাততে পারেনি'।...

Making Money Using Laws

I am astonished to see that NY DMV fined me $130 ($50 fine + $80 Surcharge) for failing to show current insurance proof. I had both current and old insurance proofs in the same envelope because the new insurance proof comes long before the old one expires. By mistake,...