Попробуйте:
public class ExtendedCompareValidator : CompareValidator
{
protected override void OnPreRender(EventArgs e)
{
if (!string.IsNullOrEmpty(this.ControlToValidate) && string.IsNullOrEmpty(this.ControlToCompare))
throw new HttpException("You have to set the 'ControlToCompare' property.");
base.OnPreRender(e);
}
}
Web.Config
<pages>
<tagMapping>
<add tagType="System.Web.UI.WebControls.CompareValidator, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mappedTagType="MyWebApp.ExtendedCompareValidator, MyWebApp"/>
</tagMapping>
</pages>