Course ASP : introduction

Course ASP : introduction 








Course ASP : introduction








Active Server Page is a web page that "executes" in a server-side execution environment in Microsoft Internet Information Server (IIS) 3.0, or higher, and that uses ActiveX scripting, normally VBScript or JavaScript code. When a browser requests an ASP page, the Web server generates a page with HTML code and transmits it back to the browser. An Active Server Page can combine HTML with scripts to create dynamic, interactive, and appealing Web pages. With ASP you can customize your Web pages to be more efficient and more receptive to your users. Some examples of what you can do with ASP include placing counters on your Web site that count the number of times your Web site is accessed, and creating a Web page that displays different information to different users.


The Differences between Active Server Pages and Conventional HTML


With conventional static HTML, the user types in a Web address and the browser sends a request for the Web page to a Web server. The Web server receives the request and retrieves the appropriate HTML file from a disk or memory and transmits it back to the browser. The user's Web browser translates the HTML file and the results are displayed in the browser window. The results are static as long as the underlying HTML page is unchanged.

Static Web pages are used when information is not expected to change much over time. Static Web pages are ideal for home pages or sites where content is not going to be modified frequently. In order to make changes to static Web pages, one must edit the HTML file.

ASP and conventional HTML work in almost the same way. One major difference between ASP and conventional HTML is that ASP is dynamic. This is because with ASP, scripting code runs on the server and produces HTML output, which is then sent to the browser for display. When a browser requests an ASP file from the Web server, the ASP interpreter reads through the ASP file, executes any of the ASP commands contained within and sends the resulting HTML to the browser. This means that the same ASP page might produce HTML that appears in the browser differently each time it is requested. An ASP file can contain any combination of HTML and script. Since ASP pages produce standard HTML, they require no specific browser.


Creating and Converting Active Server Pages

You can create ASP files using any text editor or Web development tool. Just remember to convert your existing .html page to an .ASP page by changing the file extension. This informs the server to process the page and produce the HTML output proceeding sequentially through the file. Anything not delimited as script will be sent directly to the output; any scripts will be executed and their results sent to the output.


Web Server Installation


Before being able to run ASP pages, you need to confirm that you have an ASP-enabled Web server installed on your computer. If you have installed Windows NT or Personal Web Server (PWS) for Windows 9x on your system, you were most likely asked if you wanted to install Internet Information Server (IIS). After installing IIS, you should have installed ASP. ASP is a component of the latest version of IIS, which is a component of the latest Windows NT Option Pack.


Internet Information Server (IIS)

The foundation of ASP is Microsoft's Internet Information Server. IIS utilizes scripting engines for VBScript and other languages. VBScript is the default language of ASP, however you can use other scripting languages such as JavaScript or PerlScript.

In order to run your ASP page, you must place it in a directory that is accessible to the Web server. This is because the server must first interpret the ASP file so that it can run properly. If you simply try to open the ASP file in a browser, it will not work. The ASP file itself contains VBScript that we do not want to send to the browser. However, we do want to send the output of the interpreted ASP file to the browser. This is why an ASP page will only appear correctly when a Web server sends it to the browser.

IIS's default root of the web directory for Windows NT and Windows 9x is C:\InetPub\wwwroot. The directory that we will be using as the home for the web pages we create is InetPub. Files in this directory are accessed through your browser using the URL http://localhost/page.asp, where page.asp is the ASP file you wish to view.


If you wish to place your ASP page in a folder other than the default home directory, you will need to tell the Web server where your chosen folder is by designating it as a virtual web directory.


Simple ASP Coding

When a browser sends a request to the server for an ASP page, the server interprets the ASP before it is sent out. Your page could have text that says "good morning" when a client visits your site before noon, text that says " good afternoon" to another client who first visits your site after noon, and "good evening" to the client who visits your site after the workday is over. In other words......







Download Course ASP : introduction








Course ASP : introduction 

0 commentaires: