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.1 > BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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
Thread Tools Display Modes
  #1 (permalink)  
Old July 20th, 2017, 03:13 PM
N_B N_B is offline
Authorized User
Points: 103, Level: 2
Points: 103, Level: 2 Points: 103, Level: 2 Points: 103, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Feb 2016
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 15, Page 554 - Button Click Event

I must be totally missing something, but I'm confused about these statements in the book:

On postback, the story looks quite different. When you click the button to cause a postback, the following events are raised:
— — — — — — — — -

It’s important to understand and remember that user-triggered control events like a Button control’s Click or a SelectedIndexChanged of a DropDownList occur after the Load event of the Page.

But me clicking the button obviously initiates the PostBack. So how is the event happening after the subsequent load of the page? The click is what cause the page to load, no? Very confused.
Reply With Quote
  #2 (permalink)  
Old August 4th, 2017, 03:10 PM
Imar's Avatar
Wrox Author
Points: 71,768, Level: 100
Points: 71,768, Level: 100 Points: 71,768, Level: 100 Points: 71,768, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,031
Thanks: 80
Thanked 1,580 Times in 1,557 Posts

Yes, you clicking on the button happens first. However that happens on the server side. In order to respond to that click, the Click event fires on the server. But before that can happen, other stuff needs to happen first. The page doesn't have a button that can be clicked until it's loaded for example, so those events need to happen first.

Does that help?
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!
Reply With Quote

Thread Tools
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
button click event make my web read again page load nir987 ASP.NET 3.5 Basics 4 November 29th, 2010 10:48 AM
Chapter 14 Button click event glevinw BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 6 April 26th, 2010 04:14 PM
Need to click radio button twice for event to fire areed24 ASP.NET 3.5 Basics 10 March 31st, 2009 03:27 PM
Link button click event sarah lee ASP.NET 2.0 Basics 5 May 18th, 2007 09:29 AM
Trigger event on button click speedyH ASP.NET 1.x and 2.0 Application Design 3 June 27th, 2004 10:10 AM

All times are GMT -4. The time now is 12:09 AM.

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