Saturday, March 31, 2012

Web Server

What Happens when

(1) A client requests a web page that contains client-side code from a web server.

(2) A client requests a web page that contains server-side code code from a web server.

a) page markup and client side code are sent to the client

b) server code executes on the server and resulting page markup is sent to the client.


In simple words:

(1) Simple server will serve the html and client side code in response to request.

(2) Server will execute the necessary process to serve the request and will serve the html and client side code(if any) in response to request.


when client side code is requested then it is done at the client side

when a server side code is there then it goes to the server, server will process th code and reply the client.

both are different

client side is mainly used for validation purpose and server side code is used for processing.


Right Ajay I am totally agree with you what was I mean to say that first time when your request is getting processed on the server. Once your request is processed and you have client script on the browser, then what you said is perfect.


(1) A client requests a web page that contains client-side code from a web server.

==> The client side code is sent by the server to the client. Client side script may be of the form of Javascript, jscript, vbscript etc. Third party plugins like Adobe Flash Player etc. (that processes swf files) are handled client-side. This means that the processing load happens on the client system's processor.

(2) A client requests a web page that contains server-side code code from a web server.

==> As explained above, server side code is handled by the server. The server is where the IIS is installed. The IIS handles the ASP.NET runtime engine. Must read this beautiful article ...http://aspnet.4guysfromrolla.com/articles/011404-1.aspx

I would also like to point out here, there there are situations where code seems to be handled client-side, but it actually is being handled server side...I'm talking about Ajax where partial postbacks are sent to the server (that means that the entire page is not sent for processing to the server, rather a partial page request is sent...this internally happens using Javascript's XMLHttpRequest object...view this for more...http://www.w3.org/TR/XMLHttpRequest/

HTH

Cheers

Vishal Khanna

(Pls mark as answer if reply helps)

0 comments:

Post a Comment