Monday, March 29, 2010

WebServer and ApplicationServer

WEB SERVER:
Web servers are computers on the Internet that host websites, serving pages to viewers upon request.
A Web server handles the HTTP protocol. When the Web server receives an HTTP request it responds with an HTTP response such as sending back an HTML page.
Webserver is designed for Website deployments and web based apps.

APPLICATION SERVER:
Application server is a server that provides XML web Services, WEb Applications and distributed apps.
An application Server exposes business logic to client applications through various protocols possibly including HTTP.
Application Server is used to Deploy an Application and then that application can be accessed using webserver.


The difference between WebServer and ApplicationServer is
1. Web Server serves static HTML pages or gifs, jpegs, etc.,
An Application Server is used to run business logic or dynamically generated presentation code.
2. A Web Server understands and supports only HTTP protocol, an Application Server supports HTTP,TCP/IP and many more protocols.
3. Application Server will take care of all these issues like Security Transaction Multithreading Resource pooling etc...
In Web Server it is not possible...

PROTOCOLS

HTTP(HyperText Transfer Protocol) is a request/response standard typical of client-server computing.
FTP (File Transfer Protocol) is a standard network protocol used to exchange and manipulate files over a TCP/IP-based network, such as the Internet
SMTP(Simple Mail Transfer Protocol) stands for simple mail transfer protocol.
POP3(Post Office Protocol) is an acronym Post Office Protocol.

The difference is POP is a protocol for storage of email. SMTP is a protocol for sending and receiving.

Friday, March 26, 2010

ASP.Net Page Life Cycle

Understanding the Pagelife cycle is important to develop ASP.Net application.

The general Page Life Cycle Stages are:
1. Page request - Here Page is requested by the user.
2. Start – Sets the properties such as Request, Response, IsPostBack and UICulture.
3. Page initialization - Controls on the page are available and each control's UniqueID property is set.
4. Load – Controls are loaded here if it is a PostBack request.
5. Validation – Sets the IsValid property.
6. Postback Event handling – Event handlers will be called if it is PostBack.
6. Rendering - the page calls the Render method for each control, providing a text writer that writes its output to the OutputStream of the page's Response property.
7. Unload - Unload is called after the page has been fully rendered, sent to the client, and is ready to be discarded.

Common life cycle Events:
1. PreInit – Start event of the Page life cycle and here every page controls are initialized.
2. Init – This is used to read or initialize control properties.
3. InitComplete – Used for processing tasks that require all initialization be complete.
4. PreLoad - This is used before Perform any processing that should occur before Load.
5. Load - Use the OnLoad event method to set properties in controls and establish database connections.
6. Control Event - These are control specific events such as – Button Click, DropDownIndexChanged etc.
7. Load Complete - This event is used for performing those tasks which require load has been completed.
8. PreRender - In this event page insures that all child controls are created.
9. SaveStateComplete - This event occurs after viewstate encoded and saved for the page and for all controls.
10. Render – This is not an event. The page instance calls this method to output the control’s markup, after this event any changes to the page or controls are ignored.
11. Unload – Nothing but cleanup task like closing the files, database connections etc.,

This table shows stages and corresponding Events

Stage Events/Method
Initialization of the page Page_Init
Loading of the View State LoadViewState
processing of the Post back data LoadPostData
Loading of Page Page_Load
Notification of PostBack RaisePostDataChangedEvent
Handling of PostBack Event RaisePostBackEvent
Pre Rendering of Page Page_PreRender
Saving of view state SaveViewState
Rendering of Page Page_Render
Unloading of the Page Page_UnLoad

Friday, January 15, 2010