0

I am new to c# and asp.net coding.

I have created a sample page which has a input box and submit button.

I have added regular expression so that the input box takes only numbers.

This is working fine and regular expression is showing error when characters are entered in the field.

But my problem is, when submit button is pressed how I will come to know that validation has been failed for that input box.

How the regular expression result for input box can be accessed when submit button is pressed, so that i will not proceed to save the contents of input box to database

Thanks in advance

4

1 回答 1

0

If your regular expression is working you could simply put that logic within the button. So when it is pressed the Event Click Notifier does the validation.

于 2013-03-17T04:03:18.663 回答