Chapter 1 An introduction to ASP.NET programming Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 1 Objectives Knowledge 1. Describe the components of a web application. 2. Describe the four components of a URL, and describe what happens when you omit the file name from a URL when you request a web page. 3. Distinguish between static and dynamic web pages, with the focus on the web server, application server, and database server. 4. Distinguish between the Internet and an intranet. 5. Describe these terms: HTTP request, HTTP response, and round trip. 6. Distinguish between ASP.NET Web Forms applications and MVC applications. 7. Describe the three types of environments that can be used for developing ASP.NET applications. Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 2 Objectives (cont.) 8. List the software components that you need on your own PC if you want to develop and run ASP.NET web applications in a standalone environment, including database applications. 9. Describe the class libraries and Common Language Runtime of the .NET Framework. 10. Distinguish between the aspx files and the code-behind files in an ASP.NET web application. Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 3 The Order page of a Shopping Cart application Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 4 The Cart page of a Shopping Cart application Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 5 The components of a web application ` Computer The Internet Web Server Tablet Smart Phone Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 6 A static web page Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 7 A dynamic web page Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 8 How a web server processes a dynamic web page HTTP request ` Web Browser HTTP response (with HTML) Web Server (IIS) Application Server (ASP.NET) Database Server IIS – Microsoft’s Internet Information Server ASP. NET – Active Server Pages.NET Database server – any database Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 9 The two main ASP.NET technologies ASP.NET Web Forms – Rapid Application Development ASP.NET MVC – Model-View-Controller Three other ASP.NET technologies NOT COVERED IN THIS BOOK ASP.NET Web Pages with Razor ASP.NET Dynamic Data Entities ASP.NET Reports Web Site Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 10 The four editions of Visual Studio 2012 Visual Studio Express 2012 for Web Visual Studio Professional 2012 Visual Studio Premium 2012 Visual Studio Ultimate 2012 The free edition of Visual Studio for web apps Visual Studio 2012 Express for Web What the free edition includes IIS Express SQL Server Express LocalDB Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 11 The .NET Framework .NET Applications Visual Basic Visual C# Visual C++ Visual F# .NET Framework .NET Framework Class Library Windows Forms classes ASP.NET classes Other classes Common Language Runtime Managed applications Common Type System Intermediate Language Operating System and Hardware Windows 7 Murach's ASP.NET 4.5/C#, C1 Windows 8 Other Operating Systems © 2013, Mike Murach & Associates, Inc. Slide 12 Why state is difficult to track in a web application Client Browser Browser Browser Murach's ASP.NET 4.5/C#, C1 Server First HTTP request: The browser requests a page. First HTTP response: The server returns the requested page and the application ends. Next HTTP request: The browser requests another page. The server has no way to associate the browser with its previous request. © 2013, Mike Murach & Associates, Inc. Web server Web server Web server Slide 13 Five ASP.NET features for maintaining state View state (chapter 2 and 8) Session state (chapter 4 and 8) Application state (chapter 8) Server-side caching (chapter 8) Profiles Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 14 The Future Value application after the user clicks the Calculate button Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 15 The Future Value application with error messages displayed Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 16 Future Value form in Design view – more in C2 Murach's ASP.NET 4.5/C#, C1 © 2013, Mike Murach & Associates, Inc. Slide 17