Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 31st, 2004, 05:12 AM
Registered User
 
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default RegularExpressionValidator

The RegularExpressionValidator used in ch10 to validate the email address does not fire on a null entry. This causes the system to crash when it tries to add a null entry into the database. I have tried varying the RegExp but could not get it to fire on a null entry.

I added code to detect the null entry but this required a postback to work.

I think checking data entry like this should be done client-side.

Am I missing something.

 
Old October 31st, 2004, 06:17 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

In addition to the RegularExpressionValidator, also add a RequiredFieldValidator to the page.

This is how the validators work by design; the RequiredFieldValidator makes sure the field is filled in, while the other validators make sure the field is valid.

Cheers,

Imar





Similar Threads
Thread Thread Starter Forum Replies Last Post
RegularExpressionvalidator belete ASP.NET 1.0 and 1.1 Professional 2 October 20th, 2007 01:44 PM
RegularExpressionValidator collie Visual Studio 2005 0 October 11th, 2007 07:59 AM
RegularExpressionValidator somnath.kartic ASP.NET 1.0 and 1.1 Basics 4 April 3rd, 2006 09:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.