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 July 20th, 2017, 03:13 PM
N_B N_B is offline
Authorized User
 
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:
...
GridView1_RowCreated
GridView1_RowCreated
GridView1_RowCreated
GridView1_RowCreated
Page_Load
Button1_Click
Page_PreRenderComplete
— — — — — — — — -

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.
 
Old August 4th, 2017, 03:10 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
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!





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 11: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





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