Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5 > BOOK: Beginning ASP.NET 4.5 : in C# and VB
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
Old January 27th, 2014, 07:30 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
AlanWheeler (January 27th, 2014)
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.