Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 April 22nd, 2006, 01:23 PM
Authorized User
 
Join Date: Aug 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default RequiredFieldValidator

Am using VisualStudio.Net to create ASP.Net pages. The validator is supposed to compare the InitialValue with the value of the text box it is validating when you tab to the next field. The ErrorMessage is supposed to display where the validator is if the Text property is not used. The initial value is supposed to be set to an empty string and I assume the text field value is too, so that if there is no [required] entry, then there is an error. But it does nothing when I am testing within Visual Studio running under Debug. Could it be that the initial value of the text field is null telling the validator that there is a change from an empty string? Or could it be that testing under Visual Studio does not use the control's validation as it would if tested in another way? Thanks for your ideas.
 
Old April 23rd, 2006, 01:32 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

What is the HTML for the page? A required field validator simply checks if there is text in the textbox, if not, it will display the message. If you have an initial value in the textbox, and what to see if it has changed, the requiredfieldvalidator will not work.

 
Old April 24th, 2006, 05:41 PM
Authorized User
 
Join Date: Aug 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Reply to own question:
According to the knowledge base it compares the text property to the initial value in the validator just to make sure they are different after an entry is made.
P.S. How do you keep e-mails from coming to you about every new question that appears in the forum?

 
Old April 24th, 2006, 10:00 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Click the Unsubscribe from this topic link.






Similar Threads
Thread Thread Starter Forum Replies Last Post
RequiredFieldValidator Control bnorg ASP.NET 1.0 and 1.1 Basics 1 May 3rd, 2006 04:44 PM
RequiredFieldValidator g2000 ASP.NET 2.0 Basics 1 December 22nd, 2005 06:23 PM
RequiredFieldValidator GuyB ASP.NET 1.0 and 1.1 Basics 1 November 23rd, 2005 03:11 PM
requiredfieldvalidator suzila ASP.NET 1.0 and 1.1 Basics 5 January 9th, 2004 08:19 AM





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