|Lesson 2|| Server-side scripting|
|Objective||Compare server-side and client-side scripting. |
Compare Server-side and Client-side Scripting
If you develop Web pages or applications, Microsoft's ASP performs two very important tasks:
- It lets you run scripts on the Web server instead of the client, a user's browser; and
- It allows you to incorporate scripting commands as a part of your HTML pages.
you will recognize that ASP pages look very similar.
The key difference between scripts you might have written before and those you write with ASP is that ASP scripts run on the Web server, not through the user's browser program.
When you design a Web application, you can choose to use client-side techniques ,in which scripts are run through the user's browser, or server-side techniques,
The most common technologies on the server side are:
- Common Gateway Interface (CGI)
- Server APIs
- and ASP.
Client-side approaches are usually easier to implement and do not require access to a Web server; they become complicated when you have to support different types of browsers.
Server-side solutions offer central management through Web servers' computing resources, which usually include large amounts of memory and storage.
Although server-side scripting can be a little more complicated, ASP has features, presented in later lessons, to make it easier.
Example of Classic ASP Scripting
This SlideShow illustrates an example of ASP scripting in an HTML page and its interpretation for the browser that has accessed the page:
- The user's browser requests an ASP Page just as it would any static HTML page.
- To the server, most ASP pages look like HTML pages with scripts embedded in them.
- The result of this process is an HTML page, which is transmitted to the browser
- The user's browser displays the resulting HTML code sent by the server.
ASP Responds Browser Reequest
Although the user views the result of the ASP code, calculations or decisions behind the result are not evident.
This characteristic is important as we discuss ASP functions and statements in a later lesson. The next lesson will examine an ASP script and its syntax.