Web Forms separate visual elements from the logic and code of the application, and support an event-driven model similar to a native Windows program. Again, this is a drastic change from the current ASP architecture. Figure C shows a running ASP.NET page. When the Submit button is clicked, the information entered in the controls is formatted back onto the screen. Let's look behind the scenes of this simple page.
Web Forms have the ability to use two source files.
The first, an ASPX file, contains HTML and references for .NET server-side controls. This paradigm gives developers a nice separation of visual elements and program logic, whereas ASP files are sometimes difficult to read due to the intermixing of HTML and script. Listing D is the ASPX file for our Web application. ASP.NET has over 40 server controls including Image, Button, Listbox, Calendar, and an extremely flexible DataGrid for binding ADO.NET DataSets. This code contains the event handler for the Submit button Click event.