You are on page 1of 18

Introduction

What is ASP.NET? ASP.NET is a server side scripting technology that enables scripts (embedded in web pages) to be executed by an Internet server. ASP.NET is a Microsoft Technology ASP stands for Active Server Pages ASP.NET is a program that runs inside IIS IIS (Internet Information Services) is Microsoft's Internet server IIS comes as a free component with Windows servers IIS is also a part of Windows 2000 and XP Professional

Introduction
What is an ASP.NET File? An ASP.NET file is just the same as an HTML file An ASP.NET file can contain HTML, XML, and scripts Scripts in an ASP.NET file are executed on the server An ASP.NET file has the file extension ".aspx How Does ASP.NET Work? When a browser requests an HTML file, the server returns the file When a browser requests an ASP.NET file, IIS passes the request to the ASP.NET engine on the server The ASP.NET engine reads the file, line by line, and executes the scripts in the file Finally, the ASP.NET file is returned to the browser as plain HTML

The Microsoft .NET Framework


The .NET Framework is the infrastructure for the Microsoft .NET platform. The .NET Framework is an environment for building, deploying, and running Web applications and Web Services. .NET Frameworks keywords: Easier and quicker programming Reduced amount of code Declarative programming model Richer server control hierarchy with events Larger class library Better support for development tools

The Microsoft .NET Framework



The .NET Framework consists of 3 main parts: Programming languages: C# (Pronounced C sharp) Visual Basic (VB .NET) J# (Pronounced J sharp) Server technologies and client technologies: ASP .NET (Active Server Pages) Windows Forms (Windows desktop solutions) Compact Framework (PDA / Mobile solutions) Development environments: Visual Studio .NET (VS .NET) Visual Web Developer

Three Tier Architecture in ASP.NET

Three Tier Architecture in ASP.NET


These layers are described below. 1. Application layer or Business layer 2. Business layer a. Property layer(Sub layer of business layer) 3. data layer

Three Tier Architecture in ASP.NET


Application layer is the form where we design using the controls like textbox, labels, command buttons etc.

Business layer is the class where we write the functions which get the data from the application layer and passes through the data access layer. Data layer is also the class which gets the data from the business layer and sends it to the database or gets the data from the database and sends it to the business layer.
Property layer is the sub layer of the business layer in which we make the properties to sent or get the values from the application layer. These properties help to sustain the value in a object so that we can get these values till the object destroy.

ASP.NET Web Server Controls

ASP.NET Web Server Controls


Standard Toolbox Controls Data Toolbox Controls Validation Toolbox Controls Navigation Toolbox Controls Login Toolbox Controls WebParts Toolbox Controls HTML Controls for ASP.NET Web Pages Ajax Server Controls Microsoft Ajax Extender Controls

Asp.net Page life Cycle

Asp.net Page life Cycle

PreInit :-

Life-Cycle Events

Raised after the start stage is complete and before the initialization stage begins.

Use this event for the following:


Check the IsPostBack property to determine whether this is the first time the page is being processed. The IsCallback and IsCrossPagePostBack properties have also been set at this time. Create or re-create dynamic controls. Set a master page dynamically. Set the Theme property dynamically.
Read or set profile property values.

Init :Raised after all controls have been initialized and any skin settings have been applied. The Init event of individual controls occurs before the Init event of the page. Use this event to read or initialize control properties.

General Page life-Cycle Stages


InitComplete :Raised at the end of the page's initialization stage. Only one operation takes place between the Init and InitComplete events: tracking of view state changes is turned on. View state tracking enables controls to persist any values that are programmatically added to the ViewState collection. Until view state tracking is turned on, any values added to view state are lost across postbacks. Controls typically turn on view state tracking immediately after they raise their Init event. Use this event to make changes to view state that you want to make sure are persisted after the next postback.

PreLoad : Raised after the page loads view state for itself and all controls, and after it processes postback data that is included with the Request instance.

Load :-

General Page life-Cycle Stages

The Page object calls the OnLoad method on the Page object, and then recursively does the same for each child control until the page and all controls are loaded. The Load event of individual controls occurs after the Load event of the page. Use the OnLoad event method to set properties in controls and to establish database connections.

Control events:Use these events to handle specific control events, such as a Button control's Click event or a TextBox control's TextChanged event.

LoadComplete : Raised at the end of the event-handling stage. Use this event for tasks that require that all other controls on the page be loaded.

General Page life-Cycle Stages


PreRender : Raised after the Page object has created all controls that are required in order to render the page, including child controls of composite controls. (To do this, the Page object calls EnsureChildControls for each control and for the page. The Page object raises the PreRender event on the Page object, and then recursively does the same for each child control. The PreRender event of individual controls occurs after the PreRender event of the page. Use the event to make final changes to the contents of the page or its controls before the rendering stage begins. PreRenderComplete: Raised after each data bound control whose DataSourceID property is set calls its DataBind method.

General Page life-Cycle Stages


SaveStateComplete : Raised after view state and control state have been saved for the page and for all controls. Any changes to the page or controls at this point affect rendering, but the changes will not be retrieved on the next postback. Render : This is not an event; instead, at this stage of processing, the Page object calls this method on each control. All ASP.NET Web server controls have a Render method that writes out the control's markup to send to the browser. Unload : Raised for each control and then for the page. In controls, use this event to do final cleanup for specific controls, such as closing control-specific database connections.

The following figure illustrates how the server controls on an ASP.NET page is processed by the server

You might also like