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

Hiding GridView Columns

I desperately needed to hide/show some columns of my GridView since I was showing the same user control to different groups of users and they didn't need to see the same information. The columns’ property Visible takes Boolean value true/false but doesn't take the...

প্রতারণা

ফেসবুকে আরিফ ভাইয়ের স্ট্যাটাস দেখে আমারও কিছু প্রতারণার অভিজ্ঞতা মনে পড়ে গেল… আমার গুলো অবশ্য আমেরিকাতে। বুঝতে পারছি না কারা আগে আবিষ্কার করেছে এই কৌশলগুলো? ১) ১৯৯৭ এর কথা বেশিদিন হয়নি আমেরিকাতে এসেছি। মানহাত্তানের সহ (SOHO @ Manhattan) তে একটা স্টোরে ক্যাশিয়ারের কাজ...

Realization

It dawned on me – If there was no love there would be nothing…

Sequestration Sickens Me

I thought working for our government is rewarding in itself. I am sorry to say that our legislatures love to belittle us every chance they get. We were deprived of any pay raise for the last two years when living and insurance costs went up. We already got 2% pay cut...

Voted

Last Tuesday was Election Day. There was not enough publicity about the candidates, so I didn't know anyone or their agenda. You wouldn't believe; I voted for the names that sounded better. The vote started at 7:00AM and I voted at 5:00PM. Yet, I was the 25th voter....

Analyze That

On the day of my baby boy’s birthday (last Sunday) we were eating pizzas. At one point my mother was telling me not to eat pepperoncinis that come with papa john’s pizzas because she thought it would give me gas. I ignored and ate two anyways since I never got problem...

মাততে পারেনি

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