We’ve had a “Validators.skin” file in our App_Themes dir for over a year now and it has one definition:
<asp:RequiredFieldValidator runat="server" Display="Dynamic" ErrorMessage="Required" />
That has worked on our dev machines (XP and Win7 IIS7) without problem.
We just deployed to a Win2008 test server, IIS7.5 and are getting the following error:
The 'Display' property of a control type System.Web.UI.WebControls.RequiredFieldValidator cannot be applied through a control skin.
Any idea what is happening?What happened? Everything I read about Skins and asp:RequiredFieldValidator says that you cannot set the Display property. But why is it not complaining on the dev machines?
More info
MSDN shows that the Display property became Themeable in .NET 4.0, but prior to that, it was not Themeable (change versions to see):
So that would explain why the server isn’t working… appears to be getting the error correctly.
But why, on some of our dev machines that DO NOT have .NET 4.0 installed, does this work? We even have another test server that has been running this code for years and it has always worked.
More Info
System.Web.dll on Win2k8 is file version 2.0.50727.1434
System.Web.dll on Win2k3 is file version 2.0.50727.3053
And if I use Reflector:
The .1434 version has Themeable(false) for the BaseValidator.Display property.
The .3053 version has Themeable(true) for the BaseValidator.Display property.
Anyone know where the 2.0.50727.3053 version of System.Web.dll comes from? Can it be installed on Win2k8?
The solution was to install the following updates:
http://support.microsoft.com/?kbid=959209
I don’t know why those didn’t come through Microsoft Update, but once I applied these, that error no longer occurred.