Click to See Complete Forum and Search --> : Validation controls in ASP.NET


123456sim
July 17th, 2003, 07:28 AM
ASP.NET -> i need a validator for textbox . should allow only alphanumeric non blank character. Should allow combination of numbers and a-z, A-Z alphabets without special characters and whitespaces(blank space)

ASP.NET -> i have 3 asp:buttons on my page, OK, Reset, Cancel. Reset is to blank out all the values on the page and Cancel takes you to the pervious page. OK actually processes the page. I have added some validators. I want that these validators get called only when I click OK, but now they are being called whether I click any of the 3 buttons.

Mikie
July 17th, 2003, 08:37 AM
Hi!

The buttons have a property called CausesValidation. By default this is set to true. If you change this to false on your Reset and Cancel buttons they should no longer cause any validation while doing postbacks.

Good luck!

//Mikael

coolbiz
July 17th, 2003, 10:45 PM
For Q1: Use Regular Expression Validator control.

-Cool Bizs

123456sim
July 18th, 2003, 12:35 AM
Thanks for the Causes Validation reply.

But I need the expression to be used in the RegularExpression Validator control in ASP.NET

ASP.NET -> i need a validator for textbox . should allow only alphanumeric non blank character. Should allow combination of numbers and a-z, A-Z alphabets without special characters and whitespaces(blank space)

coolbiz
July 18th, 2003, 10:22 AM
Check out http://www.regexlib.com/

-Cool Bizs