Download presentation
Presentation is loading. Please wait.
Published byCameron Gordon Modified over 9 years ago
1
Introducing ASP.NET 2.0
2
Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE, FireFox)
3
Internet Technologies WWW Architecture Client-side: HTML / XHTML (Extensible HyperText Markup Language) JavaScript / VBScript (client-side scripting) Applets / ActiveX controls Server-side: PHP JSP (Java Server Pages) ASP (Active Server Pages) ASP.NET (next generation of ASP)
4
Server-Side Code What is server-side code? Software that runs on the server, not the client Receives input from URL parameters HTML form data Can access server-side databases, e-mail servers, files, mainframes, etc. Dynamically builds a custom HTML response for a client HTTP request (form data, HTTP header data) HTTP response HTML, XML ASP page (static HTML, server-side logic)
5
Static vs Dynamic Web Pages Most Web pages that you view are not static HTML pages Instead they are dynamic generated content output from programs that run on servers These programs can interact with server resources like databases and XML Web services
6
ASP.NET Overview ASP.NET is a revolutionary programming framework that enables the rapid development of powerful web applications and services It’s a part of the emerging Microsoft.NET Platform It provides the easiest and most scalable way to build, deploy and run distributed web applications that can target any browser or device
7
Why ASP.NET? Make it easier to build web apps Make it easier to deploy web apps Make it easier to operate web apps Provide greater performance, reliability, and scalability
8
ASP.NET Capabilities 1. It’s really, really fast! 2. Deploy and upgrade running apps with XCOPY 3. Great tools support 4. Automatically detects and recovers from errors 5. Built-in output caching 6. Supports wide range of mobile devices 7. Uses compiled languages 8. Makes building web services easy 9. Much simpler page development model
9
The.NET Framework.NET Framework is a collection of technologies for the development and deployment of.NET software systems Common Language Runtime (CLR) Unifies programming models Provides robust and secure execution environment Supports multiple programming languages Provides core services Memory management (Garbage Collection) Thread management Remoting Manage Code Execution “Like” Java Runtime Environment (JRE) Code is NOT interpreted by CLR, but managed Common Language Specification Set of features guaranteed to be in all languages
10
The.NET Framework Aim of.NET : seamless interoperability A component in any.NET language can: Inherit from any other.NET language class Call the methods of any other.NET language class Benefits of.Net Rich UI Toolkit, even for the web (ASP.Net) Language independence (VB.Net, C#, J#, C++, COBOL, and others) Standard based (XML, SOAP, HTTP) Interoperability with COM .Net Framework Library Rich set of classes
11
The.NET Framework Common Language Specification Common Language Runtime VBC++C# ASP.NET: Web Services and Web Forms JScript… Windows Forms.NET Framework Base Classes ADO.NET: Data and XML Visual Studio.NET
12
Example of ASP.NET void btnSubmit_OnClick(Object sender, EventArgs e) { lbl1.Text = “Hello World!"; } start.aspx ASP.NET Directive Specify used language Server side script ASP.NET web form Note one page can have only one web form ASP.NET web control Event Handler
13
Example of ASP.NET Result Click Hello World! Client Web Browser
14
Example of ASP.NET Result Click Hello World! Client Web Browser void btnSubmit_OnClick(Object sender, EventArgs e) { lbl1.Text = “Hello World!"; } ASP.NET server control Before user clicks the button, this control is invisible ASP.NET server control All have Id and Text attributes Create browser-specific HTML Event handler function This function specifies what to do when some event occurs. In these case, it changes “lbl1” control’s text
15
Round trip start.aspx Client Browser lbl1 btn1 Post Data lbl1=“” submit=btn1 Event occurs Send data Event handler btnSubmit_OnClick Server Event occurs Example of ASP.NET
16
ASP.NET Web Forms An ASP.NET web application: Consists of any number of web pages, controls, programming classes, web services, and other files Residing within a single web server application directory The principle component of an ASP.NET web application are its web pages These are text files with an.aspx extension and are called web forms Consists of two parts: The declaratively-defined (i.e., by markup/ tags) visual elements The programming logic
17
Web Form Programming Logic A web form’s programming logic can exist in either: The same file as the visual elements i.e., the.aspx file This code is contained within a code-declaration block In a separate class file The file is usually called a code-behind file By conversation, its filename is same as.aspx file but with a language extension HelloWorld.aspx <- web form HelloWorld.aspx.cs <-code-behind file
18
Why Use Code-Behind? The real advantage of separating the code into its own file is that it may lead to more maintainable web forms One of the main benefits of ASP.NET is that a page’s programming logic can be conceptually separated from the presentation By using a code-behind file a page’s programming logic can also be physically separated from the presentation/markup
19
Why Use Code-Behind? By placing the programming code into its own file, it is also potentially easier to make use of a division of labor in the creation of the site Use whichever model you want However, all the examples in text use code-behind
20
Web Application Structure An ASP.NET web application can simply consist of a folder containing web forms and other files You can add any number of additional nested subfolders within this root folder ASP.NET has a number of reserved application folder names, e.g. App_Code App_Data App_Theme
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.