Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 July 16th, 2011, 02:35 PM
Registered User
 
Join Date: Jul 2011
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
Unhappy Try it out Ch9 pgs 311-312

It works but for some reason the validation ot the phone numbers only happens when all other checks are correct. If I submit a blank page I only get 4 of the 5 errors, I do not get an error for missing phone numbers. If I enter valid info for all fields except the phone numbers only then do I get the error.
 
Old July 16th, 2011, 03:33 PM
Registered User
 
Join Date: Jul 2011
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Found my error, Darn case sensitive language GRRRRRRR

in the ValidatePhoneNumbers function my else clause read

args.isValid = false;

Apparently it should be

args.IsValid = false; With a Capital "I" in IsValid

I would have though the VWD would have caught this, but I guess not because it is script in the markup????
 
Old July 16th, 2011, 04:46 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I would have though the VWD would have caught this, but I guess not because it is script in the markup????
Yes, indeed. The validation scripts are injected at run-time, so VWD doesn't know about them. And even if it did, it wouldn't have flagged it. Due to the untyped nature of JavaScript, it can't really tell whether isValid is valid or not. isValid may actually exist and be something else instead, or maybe you were just making something up (which you can do in JavaScript) so VWD doesn't see it as an error....

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
after adding Javascript on page 312 get error:object expected volfandt BOOK: Beginning ASP.NET 4 : in C# and VB 4 December 10th, 2010 02:38 PM
EX6_10A.cpp, pages 312, and 314 Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 0 June 7th, 2006 04:40 AM
Collapsing Margin Questions, P310-312 MRoberts BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 June 10th, 2005 10:34 AM
Multidimensional array in ch9 willburke BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 November 2nd, 2004 04:44 PM





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