Problems with RequiredRegularExpressionValidator, etc.

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
MarkI
Ensign (ENS)
Ensign (ENS)
Posts: 17
Joined: Mon Jun 02, 2008 1:54 pm

Problems with RequiredRegularExpressionValidator, etc.

Post by MarkI » Wed Jun 04, 2008 6:50 pm

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

MarkI
Ensign (ENS)
Ensign (ENS)
Posts: 17
Joined: Mon Jun 02, 2008 1:54 pm

Re: Problems with CardNumberValidator, etc.

Post by MarkI » Wed Jun 04, 2008 7:55 pm

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

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: Problems with RequiredRegularExpressionValidator, etc.

Post by Logan Rhodehamel » Wed Jun 04, 2008 10:09 pm

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.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

Post Reply