validator problem

R

ronaldo

I an writing a shopping cart application using ASP.NET/VB.Net.
I generate several text box(es) programmatically.
Each textbox store the quantity of the item that the customer want to buy.
Therefore,I create a validator for each text box.
As you know ,a shopping cart should have a "remove" button to remove item from the cart.
Therefore, I add the statement "btnRemove.CausesValidation = False" to my program, it
report that :

Unable to find control id 'myTextBox' referenced by the 'ControlToValidate' property of 'myValidator'

Unforuntately,when I remark the statement ("btnRemove.CausesValidation = False"), the validator works fine.
Here is my web site, you may take look from here.

http://cstsang.no-ip.com:53/application-demo/aspx-demo/final-project/sales/sales.htm

-select one item from the middle frame
-click on "Add to order" button
-click on "Remove" button in the right frame
-The error message will be shown in the right frame

thank you very much
 
J

John Saunders

I an writing a shopping cart application using ASP.NET/VB.Net.
I generate several text box(es) programmatically.
Each textbox store the quantity of the item that the customer want to buy.
Therefore,I create a validator for each text box.
As you know ,a shopping cart should have a "remove" button to remove item from the cart.
Therefore, I add the statement "btnRemove.CausesValidation = False" to my program, it
report that :

Unable to find control id 'myTextBox' referenced by the 'ControlToValidate' property of 'myValidator'
Make sure that both myValidator and myTextBox are inside of the same naming container. That is, they must both be inside of the same object implementing INamingContainer. For instance, if they're in different Panel controls, then you will receive the above error message.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top