System Requirements and Installation / Create an Event Handler
Subtitles of the Movie
In order to give our application the ability to respond to data entered by the user, we need to create an event handler we will talk more about events and event handlers later, for now let's just say that an event handler triggers an action in response to any particular event and processes some code. The event in this case is going to be a click or submission of this information from the web form. Now we don't put the code directly into the web form, we are going to put the code into what's called the code behind page. To make all this very simple and easy, because it's something you'll be doing frequently, the way Visual Studio works is to let you create an event handler for a particular control, simply by double clicking that control. So let's double click the submit button and see what happens. Aha, this looks a little bit different, notice that WebForm1.aspx.vb has opened up on the screen. This is a different file, it's got a slightly different name, it's .vb because this is a Visual Basic template and we're going to be programming in Visual Basic and down here the cursor is already inside our event handler for the Button1 click event. We're going to have to write some code in there, but before we get started let's close up the toolbox to give ourselves a little bit more room. Alright, now in our code area, what we want to do is capture the information that the user has submitted, do some kind of checking to find out if that information meets a certain criteria or doesn't, and send a response back to the user based on what was entered.
Tutorial Information
| Course: | Microsoft Visual Studio .NET |
| Author: | Dave Mercer |
| SKU: | 33420 |
| ISBN: | 1932072276 |
| Release Date: | 2003-04-01 |
| Duration: | 7 hrs / 101 lessons |
| Work Files: |
Yes |
| Captions: | For Online University members only |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 