Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : 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 April 6th, 2017, 01:45 PM
Authorized User
 
Join Date: Mar 2017
Posts: 55
Thanks: 12
Thanked 0 Times in 0 Posts
Default Ch 9 - Validating User Input

On page 324 of ch-9, I created the file Email.aspx based on MyBasePage, inheriting my Master Page.

Step # 3 states that I have the option to set the handler by using the two drop-down lists at the top of the documents window.

For me, however, the only option I saw in the first drop down was:

Demos_Email with a sub-item of (Demos_Email Events)
When I select this item, the 2nd drop-down gives me many options, "Load" included. When I select "Load", I get the following code:

Code:
Private Sub Demos_Email_Load(sender As Object, e As EventArgs) Handles Me.Load
But when I double-click in the design view I get:
Code:
 Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
This equals the example in the book.

Are these 2 above, the same? Because when I go inside the Page_Load sub, I see the options I mentioned previously in the drop-down list.

BUT...if I create the 1st Private Sub Demos-Email_Load above, and THEN double click in the design view - it generates the 2nd code below the Private Sub code.

Why can't I use the drop-downs (as the book mentions) to create the Protected Page_Load sub?
 
Old April 9th, 2017, 02:13 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yeah, they are eventually the same as the name of a method is arbitrary. It's this part that's important:

Handles Me.Load

This tells .NET that your method will handle the page's Load event.

Not sure why it doesn't work for you. Did you follow the steps exactly?

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 April 9th, 2017, 05:18 PM
Authorized User
 
Join Date: Mar 2017
Posts: 55
Thanks: 12
Thanked 0 Times in 0 Posts
Default Following steps

Well, I did follow the steps, but did not get the Protected Page_Load snippet.
Rather, I got the Private Demo_Email_Load snippet.

I didn't even see the word "Page" in the first drop down. No worries though, I would guess, if you're confirming that the two are the same, just a different name.

Although, I'm not sure about why the drop down provided "Private" and double-clicking the page provided "Protected".





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 9 validating user input crossfire19 BOOK: Beginning ASP.NET 4 : in C# and VB 4 December 13th, 2013 11:10 PM
Chapter 9 Validating User Input Don Hurlbert BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 7 August 18th, 2010 02:42 PM
ch-9 Validating user i/p. pg no-309 & 315 mr malik BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 February 17th, 2010 11:21 AM
validating user input hosefo81 Javascript How-To 12 March 3rd, 2004 09:32 AM
Validating user input stu9820 VB.NET 2002/2003 Basics 2 January 15th, 2004 12:51 PM





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