Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

18: Basic Web Programming > Event Handlers

Event Handlers

You can add event handlers that are invoked on the server to Web server controls. The Button control can include a Click event; the DropDownList offers the event SelectedIndexChanged, and the TextBox offers the event TextChanged.

The events occur on the server only when a postback occurs. When a value in a text box changes, the TextChanged event doesn't occur immediately; instead, the TextChanged event only occurs when the form is submitted and sent to the server, which happens when the Submit button is clicked. The ASP.NET runtime verifies that the state of the control has changed to invoke the corresponding event handler. If the selection of the DropDownList has been changed, the SelectedIndexChanged event is invoked; the TextChanged event is invoked accordingly when the value of a text box changes.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint