Page 1 of 1

Problems with RequiredRegularExpressionValidator, etc.

Posted: Wed Jun 04, 2008 6:50 pm
by MarkI
Hi,

I've a page that uses the CreditCardValidator that is in the CommerceBuilder.Web assembly. I register it like this:

Code: Select all

<%@ Register Assembly="CommerceBuilder.Web" Namespace="CommerceBuilder.Web.UI.WebControls" TagPrefix="cb" %>
I then insert it into a control like this:

Code: Select all

<cb:CreditCardValidator ID="CardNumberValidator" runat="server" 
                ControlToValidate="CardNumber" ErrorMessage="Please enter a valid card number."
                Display="Dynamic" Text="*" ValidationGroup="CreditCard"></cb:CreditCardValidator>
This creates an automatically generated line in the control's designer.cs file:
protected global::CommerceBuilder.Web.UI.WebControls.CreditCardValidator CardNumberValidator;

The problem is that when I build, I get the following error on the line in the designer.cs file:
Error 4 The type 'Sample.Web.UI.Compatibility.BaseValidator' is defined in an assembly that is not referenced. You must add a reference to assembly 'Validators, Version=1.0.0.0, Culture=neutral, PublicKeyToken=08d88f24895e085d'. C:\HighwayMediaPrototype\Orders\CreditCardForm.ascx.designer.cs 118 78 HighwayMediaPrototype

Further investigation reveals that ANYthing in the CommerceBuilder.Web assembly that uses Sample.Web.UI.Compatibility.BaseValidator as its base class causes this error. I played around with tagMapping in the web.config, but without any luck.

Any help is greatly appreciated.

Mark

Re: Problems with CardNumberValidator, etc.

Posted: Wed Jun 04, 2008 7:55 pm
by MarkI
I've been doing more research and am wondering if the CardNumberValidator is supposed to do what its name implies. The sticky thread about credit card validation makes me wonder if the CardNumberValidator is more of an example of what can be done than a method that actually validates credit cards. Further information on this would be great to have.

And the title of this thread should be "Problems with CardNumberValidator, etc.", not "Problems with RequiredRegularExpressionValidator, etc", though both CardNumberValidator and RequiredRegularExpressionValidator cause the same assembly error.

Many thanks,

Mark

Re: Problems with RequiredRegularExpressionValidator, etc.

Posted: Wed Jun 04, 2008 10:09 pm
by Logan Rhodehamel
You need the "Validators" assembly to use that control. It is included in the BIN folder. This is required for compatibility with AJAX, for the time being.

Credit card validator can validate a card number meets the MOD10 rule, and also can verify against card type.