Validation in Gridview - ASP.NET

  • Thread starter Guido Pederzini
  • Start date

G

Guido Pederzini

Hi all,
my problem is in the validation of a textbox in a gridview. I have to check
a quantity that must be a positive number greater than zero.

In the XML I have used in a ItemTemplate a TextBox with
1) RequiredFieldValidator (for the existence)
2) CompareValidator (for the positive number)
3) RegularExpressionValidator (it's must be a number)

The problem is that when I fire the "OnClick" event , all the textbox in the
gridview display the error message associated to the failed validation, and I
want that only the row in which I have clicked display it.

I've found a workaround, in the code behind i check all the rules and I
display an alert with Javascript, but I would know if it's possible to
control, with the asp.net validator, only the row that fired the onclick
event.

Any help will be appreciated. Thanks!
Guido Pederzini
 
Ad

Advertisements


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