Page 214 - DCAP408_WEB_PROGRAMMING
P. 214

Web Programming




                    Notes          When a web browser requests an ASP page, the following steps occur:
                                      The client locates the web server specified by the first part of the URL(www.something.com)
                                      The client then requests the ASP page specified by the second part of the URL(/default.asp)
                                      The web server reads the ASP file and processes the code.

                                      After the ASP page has been completely processed by the web server, the output is sent in
                                       HTML format to t==he client.
                                      The client receives the HTML sent by the server and renders it for the user.

                                                                     Figure  8.2



                                                         Client requests ASP file
                                                                                                 Server locates
                                                                                                 the ASP file on
                                                                                       Server    the hard drive
                                                                                                 and, removing
                                       Client
                                                                                                 all ASP script
                                                                                                 and replacing it
                                                                                                 with HTML text
                                                                                                 passes it

                                                     Server returns HTML text to client



                                   8.3.1 How ASP differs from Client-Side Scripting Technologies?


                                   Client-Side Scripting is programmatic code in an  HTML file  that runs on the browser. It is
                                   denoted by <SCRIPT> HTML tag. It is commonly written using the JavaScript programming
                                   language due to the fact that Netscape Navigator only supports the JavaScript scripting language
                                   for Client-Side scripting. ASP scripts are server -side scripts.
                                   While using ASP, its code exists on the server only. ASP code, which is surrounded by the <% and
                                   %> delimiters is processed completely on the server. The client cannot access this ASP code.




                                     Notes  Note that the Server-side script is also used to create applications which need a
                                     broad reach: applications that  might be accessed by many different types of browsers,
                                     each with different capabilities.

                                   Differences

                                   A Client-Side script is processed only by the client. It is the client’s responsibility to execute all
                                   Client-Side scripts on the other hand; Server-Side scripts are processed completely on the web
                                   server. The client does not receive any code from server side scripts rather the client receives just
                                   the output of the Server-Side scripts.
                                   Client-Side scripts and Server-Side scripts cannot contract with one another because the Client-
                                   Side script are executed on the  client, after the service side scripts  have finished  processing
                                   completely.





          208                               LOVELY PROFESSIONAL UNIVERSITY
   209   210   211   212   213   214   215   216   217   218   219