Internet database access using Active Server Pages

 

Jelena Galic, B.Sc. EE & CS (galic@EUnet.yu)
Miroslav Pesic, B.Sc. EE & CS (
pesicm@EUnet.yu)

 

Essence of dynamic content on the Web

Static Web content:

Dynamic Web content:

 

ASP vs. CGI

Essence of CGI (Common Gateway Interface):

 

Essence of ASP (Active Server Pages):

  • ASP are made of server-side scripts completely integrated with HTML files.
  • ASP documents have .asp extension.
  • Scripts are separated from HTML tags and text using special delimiters (<% and %>). Scripts can be placed anywhere inside or outside HTML document.
  • Server-side script engine processes all .asp documents requested by Web clients. HTML code parts are sent to clients and script parts are interpreted. Script output is sent together with HTML code.
  • Standard support for VBScript (Visual Basic Scripting Edition) and JavaScript. Other script languages can be supported too with appropriate server-side script engine.
  • ASP have support for client certificates through Secure Sockets Layer (SSL) or Private Communications Technology (PCT1).
  • Easy to create, with no manual compiling or linking of programs required.
  • Great control of HTML output. It it possible to use visual Web page editors and visually insert scripts.
  • Object-oriented and extensible with ActiveX server components.
  • ASP is Microsoft technology. Requirements:
  •  

    More on ASP

     

    An ASP example

    Consider the following form.

    <FORM ACTION = "/scripts/submit.asp" METHOD = "post">
    <P>Your first name: <INPUT NAME = "firstname" SIZE = 48>
    <P>What is your favorite ice cream flavor: <SELECT NAME = "flavor">
    <OPTION>Vanilla 
    <OPTION>Strawberry 
    <OPTION>Chocolate 
    <OPTION>Rocky Road</SELECT>
    <p><INPUT TYPE = SUBMIT>
    </FORM>
     

    From that form, the following request body might be sent.

    firstname=James&flavor=Rocky+Road
     

    The following script can then be used.

    Welcome,  <%= Request.Form("firstname") %>. 
    Your favorite flavor is <%= Request.Form("flavor") %>.
     

    The following output is the result.

    Welcome, James. Your favorite flavor is Rocky Road.
     

    If the following script is used:

    The unparsed form data is:  <%= Request.Form %> 
     

    The output would be:

    The unparsed form data is:  firstname=James&flavor=Rocky+Road