240 likes | 518 Vues
12. Web Forms and ASP.NET. Programming Right from the Start with Visual Basic .NET 1/e. Objectives. Understand the relationship between HTML and ASP.NET Understand how web applications work in terms of the client/server model Develop ASP.NET applications using a text editor.
E N D
12 Web Formsand ASP.NET Programming Right from the Start with Visual Basic .NET 1/e
Objectives • Understand the relationship between HTML and ASP.NET • Understand how web applications work in terms of the client/server model • Develop ASP.NET applications using a text editor
Objectives (cont.) • Develop ASP.NET applications using Visual Studio .NET • Understand the similarities and differences between Windows Forms and Web Forms • Develop interesting web applications using ASP.NET and Visual Studio
12-1 HTML andStatic Web Pages • HTML stands for Hypertext Markup Language, a language for displaying text in a web browser such as Internet Explorer or Netscape Navigator. • Text is marked by tags consisting of a left angle bracket (<), a tag name, and a right angle bracket (>).
12-1 HTML andStatic Web Pages (cont.) • Tags are usually paired to start and end the tag instruction. • The end tag looks like the start tag except a slash (/) precedes the text with the brackets. • Some tags can be used without an end tag.
12-2 Web Applications • A web application is a client/server application that lives on a web server. • The client is the user’s machine with an Internet browser. • The web server is a machine that stores the web documents, including web pages and server scripts.
Round Trips • Postback is when a user action occurs that requires server processing and the form is posted back to the server. • The web server processes the request and generates new HTML that is returned to the client browser. • This sequence of events is referred to as a round trip.
12-3 ASP.NET • ASP.NET is a platform for developing and running web applications on a web server. • ASP.NET web applications can be developed with a simple text editor or with the assistance of Visual Studio .NET. • Microsoft’s Internet Information Services (IIS) is a web server for use on Windows machines.
12-4 Visual Studioand Web Forms • Visual Studio provides the following tools: • Visual designers • Code-aware editors • Integrated compilation and debugging • Project management facilities for creating and managing application files
12-4 Visual Studioand Web Forms (cont.) • Visual Studio supports Web Forms to quickly and easily create the user interface for ASP.NET web applications. • A Web Form is composed of two files, the user interface form and the code-behind file. • Web Forms are similar to Windows forms in that they are event driven.
ASP.NET Illustrated:Jake’s Problem • Begin by starting a New Project and selecting ASP.NET Web Application. • If Visual Studio is successfully able to communicate with the web server, then it will create a project on the server and open WebForm1.aspx for editing.
ASP.NET Illustrated:Jake’s Problem (cont.) • The programming logic resides in a code-behind file with an .aspx.vb extension. • The logic written in the code-behind could have been written with any .NET language such as C#. • When the application is run Visual Studio launches Internet Explorer and connects to the ASPX page on the server.
Chapter Summary • HTML stands for Hypertext Markup Language, a language for displaying text in a web browser such as Internet Explorer or Netscape Navigator. • Web applications are web sites that go beyond normal, static web sites by adding the ability to process code in response to user input.
Chapter Summary (cont.) • Web applications are also client/server applications. • When a user action occurs that requires web server processing, the form must be posted back to the server. • ASP.NET is a platform for developing and running web applications on the web server.
Chapter Summary (cont.) • Web Forms allow quick and easy creation of ASP.NET web applications. • Web Forms are similar to Windows Forms in that they are event driven.
12 Web Formsand ASP.NET Programming Right from the Start with Visual Basic .NET 1/e