410 likes | 857 Views
Module 1 : An Introduction to ASP.NET. Contents. .NET Framework and VS.NET Introduction to ASP.NET Advantage Features of ASP.NET Internet Information Services (IIS) Virtual Directory Introduction to Webform Visual Studio Web Site Types ASP.NET Directives. What is the .NET Framework?.
E N D
Contents • .NET Framework and VS.NET • Introduction to ASP.NET • Advantage Features of ASP.NET • Internet Information Services (IIS) • Virtual Directory • Introduction to Webform • Visual Studio Web Site Types • ASP.NET Directives
What is the .NET Framework? Developer Tools Clients ASP.NET Web Applications Databases XML Web Services User Experiences .NET Framework
What Problems Does .NET Solve? • Even with the Internet, most applications and devices have trouble communicating with each other • Programmers end up writing infrastructure instead of applications • Programmers have had to limit their scope or continually learn new languages
The .NET Framework Components Message Queuing COM+ (Transactions, Partitions, Object Pooling) IIS WMI Visual Basic C++ C# Perl Python … XML Web Services User Interface ASP.NET ADO.NET and XML .NET Framework Class Library Common Language Runtime Win32
Benefits of Using the .NET Framework MFC/ATL .NET Framework Windows API Visual Basic ASP 1990’s 2000’s 1980’s • Based on Web standards and practices • Functionality of .NET classes is universally available • Code is organized into hierarchical namespaces and classes • Language independent
Visual Studio .NET: The Tool for .NET Development Web Forms Tools Windows Forms Tools Visual Studio .NET Multiple Languages Error Handling Web Services Tools Data Access Design Develop Debug Deploy
Introduction to ASP.NET • Microsoft introduced Active Server Pages in December 1996. Microsoft made it available for its Internet Information Server (IIS) • ASP Page is saved with an extension of .asp • ASP code can be written in VBScript or Jscript • An Active Server Page is like a standard HTML file, and can contain HTML tags that will not be interpreted by the server, they are sent to the browser along with the plain HTML generated from the ASP code embedded in it
Introduction to ASP.NET • ASP.NET is a part of the new framework for Internet functionality in .NET • ASP.NET has been designed to provide the features, which were not covered in ASP, as it has been built on common language runtime that can be used on a server to build powerful web Applications
Advantage Features of ASP.NET • Better Performance : An ASP.NET file is compiled only the first time it is accessed. If the page has been sent back then, only modified area is read at server • Simplicity : ASP.NET framework allows you to create a web application that cleanly separates application logic from presentation code • Language support : Object Oriented Language : C# , VB.NET
Advantage Features of ASP.NET • Security : ASP.NET supports Windows ,HTML forms and Passport based authentication • Caching : Caching is a technique that is used widely to increase the performance by keeping frequently accessed or expensive data in memory (3 types of caching : Output ,Data, Fragment Caching)
Internet Information Services (IIS) • Software intergrated with Windows OS to manage all Web Applications • Start at : Control Panel Administrative Tools Internet Information Services
Virtual Directory • Main Web Directory located at : C:\InetPub\wwwroot\ • Virtual Directory is a virtual directory in sense that it doesn’t exist. It only maps with the existing directory, which contains real files
Virtual Directory • Create Virtual Directory Using IIS
Virtual Directory • Create Virtual Directory Using IIS
Virtual Directory • Create Virtual Directory Using IIS
Webform • ASP.NET web forms are nothing but text files, saved with an extension of .aspx • As you have already seen, the web forms can be created in the following three ways: • Notepad • FrontPage • Visual Studio .NET
Webform • Features: • Browser-independent applications : Web Forms provide a framework for creating all application logic on the server, eliminating the need to explicitly code for different browsers and their capabilities • Event-based programming model : Web Forms bring to Web applications the model of writing event-handling methods for events that occur in either the client or server
Webform • Features: • State management : The Web Forms framework automatically handles the task of maintaining the state of your form and its controls • Scalable server performance : The Web Forms framework allows you to scale your application from one computer with a single processor to a multi-computer Web farm cleanly and without complicated changes to the application's logic
Visual Studio Web Site Types • You can use Visual Studio 2005 to create any of the following Web site types: • File-system Web sites • Local Internet Information Services (IIS) Web sites • Remote IIS Web sites • FTP sites
Default Event Handling in Web Applications • Many ASP.NET objects support multiple events • Objects with multiple events usually supporta default event • Visual Studio 2005 and ASP.NET provide multiple ways for working with events • Visual Studio 2005 provides quick access todefault events
Create ASP.NET Web application • Using Visual Studio .NET
Why Visual Studio .NET? • One IDE for multiple languages and multiple project types • Multiple languages within a project • Multiple project types within a solution • Integrated browser • Debugging support • Customizable interface
Start Page • Online support access • Recent projects
Integrated Development Environment (IDE) SolutionExplorer Editor/Browser Object Browser Toolbox Properties Dynamic Help
Visual Studio .NET • The advantage of using Visual Studio is that it provides tools that make web Application development much faster, easier, universally readable and much more robust. These tools include: • Visual designers • Code-aware editors • Integrated compilation and debugging • Project management
File Types • *.aspx : webform file • *.aspx.vb (.aspx.cs) : code behind file • Web.config : web application configuration file • Global.asax : application event file
Web Configuration Files • Web application settings are contained in XML-based configuration files • Server settings—machine.config • Root Web setting—web.config • Web site settings (optional)—web.config • ASP.NET application root settings (optional)—web.config • ASP.NET application subfolder (optional)—web.config • Effective settings are provided by merging settings in the configuration hierarchy • Web Site Administration Tool for Visual Studio 2005 can be used to modify application configuration files
Webform model • All webform class inherits from System.Web.UI.Page : • Page. IsPostBack : Gets a value indicating whether the page is being loaded in response to a client postback, or if it is being loaded and accessed for the first time • Page.Response.Write (string) : Write a document line to webform
Webform Life Circle • Page_Init : the first event, controls have not finished loaded • Page_Load : controls have finished loaded • Page_Unload : Before page closing • Controls event : ex Button_Click
Understanding the Page Event Life Cycle Page is disposed Page_Init Page_Load Control events Textbox1_Changed Change Events Button1_Click Action Events Page_Unload
Visual Studio Web Site Types • File-system Web sites • Local IIS Web sites • Remote IIS Web sites • FTP sites
Default Event Handling in Web Applications • Many ASP.NET objects support multiple events • Objects with multiple events usually supporta default event • Visual Studio 2005 and ASP.NET provide multiple ways for working with events • Visual Studio 2005 provides quick access todefault events
ASP.NET Directives • ASP.NET supports few directives, which are used to specify optional settings used by the page compiler when processing ASP.NET files • These directive can be placed anywhere in the page but conventionally these are placed at the top of the file .aspx <%@ directive attribute=value [attribute=value …] %>
ASP.NET Directives • Some of directive : Page, Control, OutputCache, Register… • Directive Page : one per webform <%@ Page Language="vb" AutoEventWireup="false“ Codebehind="WebForm1.aspx.vb" Inherits="WebForm1“ %>