Wrox Programmer Forums
|
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 March 28th, 2013, 01:34 PM
Friend of Wrox
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default The validation question.

Is it not your assertion that you make in the book that it is more preferable to validate user input from both the client side and then validate user input on the server side as well? This way (and I could be wrong here) according what is written in your book, if a user puts in bad data on the user input form, that it will be stopped before the form can post back to the server therefore not using up server and network bandwidth and allowing the user to correct anything before it is sent back to the server. Also if the user manages to get past client side validation to put in some kind of malicious information on the web form it will then be caught at the server and stopped there. Is that correct? Is that not the optimal form of validation that should be used on ASP.Net web forms?

Also I am just a little bit concerned in regards to the intelli-sense on the Javascript part of the application. It seems to me like sometimes the intelli-sense in the VS environment can maybe just a little bit spotty and not quite as robust when working with Javascript on the client side of things as it is in the code behind files. Sometimes it works and other times it goes missing in action, whereas in the code behind it seems to work just fine.
Also on your .ascx file, I noticed that there doesn't seem to be the opening and closing <Html> or even <body> tags that you would see on your typical web form. Is that just me or is that just by design? I am just a little bit confused about that.
 
Old March 28th, 2013, 03:48 PM
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,

1) I always get confused by your double or triple negated questions, but I believe the answer is yes. As explained in the book, client side validation is just a courtesy to the user. Server side validation is the only real way to protect your data / server.

2) This is by design; JavaScript is not strongly typed, and code can can scattered across files, and does VS can't be as accurate as with C#. It gets better which each version.

3) Correct. As explained in the book, a user control is meant to be consumed in a web form or master page that already have these elements.

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!
 
Old March 28th, 2013, 04:31 PM
Friend of Wrox
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default

3) Correct. As explained in the book, a user control is meant to be consumed in a web form or master page that already have these elements.


Oh yes I see it is just like partial page layout in MVC. As in a render section in a razor webview.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 9 - Validation question Rushino BOOK: Beginning ASP.NET 4 : in C# and VB 3 April 26th, 2010 03:47 AM
About a question with validation nealwang1019 XML 7 May 7th, 2009 03:52 PM
About a question with validation nealwang1019 BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 0 May 4th, 2009 10:58 AM
Validation Question mar0364 VBScript 8 July 26th, 2004 02:37 PM
Validation question savoym C# 2 July 19th, 2004 07:23 AM





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