Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : 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 January 26th, 2014, 06:33 PM
Authorized User
Points: 416, Level: 7
Points: 416, Level: 7 Points: 416, Level: 7 Points: 416, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2013
Posts: 84
Thanks: 29
Thanked 2 Times in 2 Posts
Default Ch 9 Input Validation - client vs. server

Hi Imar,

Since my post on Jan 24 last Friday I've made it to Ch 9 which I'm still wrapping up.

As I was playing around with the project I set a breakpoint in ContactForm.ascx.vb on the 'If' statement for the CustomValidator1_ServerValidate method that handles the server side validation. I don't remember why I did that, but the result seemed pretty neat.

Every time I tried to 'send' the email with a violation of the rules, the breakpoint was not executed. I think that nicely shows the client side validation is really occurring at the client. When the data is finally setup correctly and the 'send' is clicked, the breakpoint executes showing that the server side validation for the phone numbers goes into action. I decided to try it in and saw a similar effect with a breakpoint in the Page_Load method of the Frontend.master.vb file.

Even though I stumbled on it, it seemed like a pretty neat demo to me. Hopefully this doesn't come across as presumptuous, but I didn't know if it would be useful in whatever version of the book comes next. I just thought I should share it with you now; unless of course I'm misunderstanding what's happening here.

Best Regards, (or Cheers)
Alan

Last edited by AlanWheeler; January 26th, 2014 at 06:36 PM.. Reason: change title
 
Old January 27th, 2014, 07:30 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Alan,

Yes, this makes perfect sense. The code doesn't fire at the server until all your client side validation has passed. You could disable JavaScript in the browser and you would see that the server side functionality does fire immediately.

Debugging is only discussed in Chapter 18, so it's not something that can easily be explained in Chapter 9. However, the debugging chapter has some demos that show you end to end debugging from client side code into a server side web service, so hopefully you find that demo interesting as well.

Thanks for your suggestion.

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!
The Following User Says Thank You to Imar For This Useful Post:
AlanWheeler (January 27th, 2014)




Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Validator daveharney BOOK: Beginning ASP.NET 4.5 : in C# and VB 9 January 15th, 2014 05:05 PM
Chapter 9 Custom validator - client siden not working; popup for phone not showing nkem BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 9 January 23rd, 2012 10:11 AM
Custom validator barakros BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 February 25th, 2010 07:58 AM
DDL Custom Validator AspNetGuy BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 June 6th, 2008 05:17 PM
Custom Validator bmains ASP.NET 1.0 and 1.1 Basics 4 December 18th, 2003 11:45 AM





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