Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5 > BOOK: Beginning ASP.NET 4.5 : in C# and VB
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 July 21st, 2013, 12:36 AM
Authorized User
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
Default Chapter 2, possible errata - Page_Load event in code behind

On page 50, step#5 there may be a conceptual misstatement. Here it says that the code "fires when the page loads in the browser." I don't know this is technically correct.

This code fires when the page loads on the server, BEFORE it gets sent to the browser. After it gets processed on the server and transformed into HTML, it gets sent to the client, at which time the HTML page actually loads in the browser.

An example of an event that actually fires upon loading in the client browser would be the JavaScript event called window.onload.
Old July 21st, 2013, 12:46 AM
Authorized User
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post

By the way, I'm not trying to be nit picky. Rather, these small details are so crucial. You hear people describing things like this a lot, but it's so important to clarify these concepts and keep them straight (details like this can make all the difference in the world, from a programming perspective - as you know). The challenge to web programming, like most anything, isn't so much the tools or clicks, but the concepts and understanding exactly what's occuring from a logical step by step standpoint.
Old July 25th, 2013, 06:38 PM
Authorized User
Join Date: Jun 2013
Posts: 36
Thanks: 1
Thanked 4 Times in 4 Posts
Default Page_Load event handler

This must be a mistake in the book - Page_Load event has nothing to do with the browser, it is a server side event and the word "load" refers to ASP.NET server controls:
<asp:Label ID="Label1" runat="server" />
At this point in the page life cycle the server controls are "loaded", their state is reconstructed from the viewstate, you can do something to them in the code that runs within this handler:

protected void Page_Load(object sender, EventArgs e)
{ // code that fires on the server
    Label1.Text = "We can put a new text here";
e.g. "Text"-property of the Label control with ID of "Label1" can be changed to something else.
Old July 30th, 2013, 02:00 PM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Rather, these small details are so crucial.
I agree. I should have worded it differently. Since it's an introductory chapter I wanted to keep things simple, and this issue slipped through. Later chapters dig much deeper in how this works, and when pages are processed and which events they raise.


Imar Spaanjaars
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
Couple Of Code Errata AspNew BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 1 June 22nd, 2009 03:36 AM
Load external script within Page_Load Event kwilliams General .NET 0 October 9th, 2006 10:56 AM
Call right frame Page_Load event from left frame. ochanarachel Classic ASP Basics 0 January 28th, 2005 05:13 AM
Can not find Code and Errata? naveed ahmed All Other Wrox Books 4 August 19th, 2003 08:20 AM
PhilePage.cs Page_Load event betulus BOOK: ASP.NET Website Programming Problem-Design-Solution 2 June 10th, 2003 02:46 AM

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