ASPX Session xi(page lifecycle)

13
Page Life Cycle Basic Objects of .NET ASP.NET File Types Web Form and Web Services Exception Handling

Transcript of ASPX Session xi(page lifecycle)

Page Life Cycle

Basic Objects of .NET

ASP.NET File Types

Web Form and Web Services

Exception Handling

Page Life Cycle

Continue…….• Sequence of events are as follow:1. PreInit

2. Init

3. InitComplete

4. PreLoad

5. Load (before any control events)

6. LoadComplete

7. PreRender(after any control event)

8. PreRenderComplete

9. SaveStateComplete

10.Unload

Continue……Handling Page Events

• Whenever you request a page, a particular set of events is raised in a particular sequence.

• This sequence of events is called the Page execution lifecycle.

Cross-Page Posting

• Under some circumstances, you might want a page to post to a different page, not to itself. This is referred to as cross-page posting.

Page Model

• You can create Single-File code model and Code-Behind page model.

Basic objects of .NET

Response Object: Response object is called the output object. It represent information going out from the server to

the browser. Collection : Cookies. Properties : Cache Control, Charest, Content Type,

Expires, Expires Absolute, Is Client Connected, Status etc.

Methods : Append To Log(), Binary Write(), Clear(),End(), Flush(), Redirect(), Write().

Continue…… Request Object:

• The Request object is called the input object. • This objects represent information coming into the

Web Server from the browser . collections are: Cookies, Form ,Query String, Server

Variables Methods are: Binary Read ()

Continue……. Server Object: The Server object is used to access properties and

methods on the server.

Properties: Script Timeout . Methods: Create Object , Get Last Error() , HTML Encode,

Map Path, Transfer, URL Encode

Continue……. Session Object: Variables stored in a Session object hold information

about one single user, and are available to all pages in one application.

Collections: Contents, Static Objects. Properties: Code Page, LCID, SessionID, Timeout. Methods: Abandon, Contents. Remove(), Contents.Remove

All() . Events: Session_On End, Session_OnStart .

Continue…..Application Object: This object is used to store and access variables from any

page, just like the Session object. The difference is that ALL users share ONE Application

object (with Sessions there is ONE Session object for EACH user).

Collections: Contents, Static Objects Methods : Contents. Remove(), Contents.RemoveAll(),Lock(),

UnLock() . Events : Application_OnEnd, Application_OnStart,

Application_OnError .

ASP.NET File TypesWeb.Config FileGlobal.asax FileWebForm.aspx FileWebForm.aspx.cs FileUserControl.ascx File

Special File in ASP.NET WebsiteConfiguration and Global Application file:

• ASP.NET provide various way to handle an application on different levels.

• You can handle website generally on three level- 1. Control level2. page level3. application level

• To handle at application level we use configuration (Web.config) and Global application(global.asax) file.

Web Services

A Web Service Is Any Piece of Software that Makes it Available Over The Internet And Uses. A STANDARDISED XML MESSAGING SYSTEM.XML

is used to encode all communication to a web service.