Dynamic-CD
Search : 
  Powered by FindinSite

ASP Documentation
Overview
• Introduction
• Getting started
• Dynamic-CD wizard
Passwords & Encryption
• Overview
• Example 1
• Example 2
Scripts
• The script language
• Script examples
• Database scripts
Technical details
• Applications
• Built-in objects
• Character Encoding
• Cookies
• Database CDs
• Development tips
• FAQs
• Future developments
• Global.asa
• Network support
• Object registration
• Resources
• ScriptingContext
• Server-side includes
• Sessions
• Technical limits
    
The ASP script language

Dynamic-CD provides server-side processing of data passed between pages by interpreting scripts written in the ASP script language.

Dynamic-CD's ASP is an emulation of the Microsoft ASP (Active Server Pages) script language and is interpreted by the VBscript engine installed with Internet Explorer in Windows 98 and later. This means that the power of VBscript is available to your Dynamic-CD.

VBscripts are often included in HTML pages to be interpreted by your browser. Now, with Dynamic-CD, VBscripts can also be processed server-side.


Introduction
To activate Dynamic-CD server-side processing, write a script in ASP and give the script file an  .ASP  extension. When a user navigates to an  .ASP  page, Dynamic-CD will automatically parse and execute the script.

The ASP script language is essentially ASP (Active Server Pages). A script starts with the delimiter  <%  and terminates with the delimiter  %> . ASP script code and HTML code can be mixed freely.

Example :
To pass a value from one page to another, first write a standard HTML page with a  <FORM>  element :

index.htm

<HTML><BODY>
<FORM action="formScr.asp" method="POST">
<INPUT type="text" name="userName" value="fred">
<INPUT type="submit" value="ENTER">
</FORM>
</BODY></HTML>

When the user presses the "submit" button, the text thay have entered is passed to the script file "formScr.asp" :

formScr.asp
 
 <%
userName = Request.Form( "userName")
 %>
<HTML>
<BODY>
You entered : "<%=userName%>"
</BODY>
</HTML>
 

 You entered : "fred"
 

The script grabs the "userName" entered in the form and displays it in a new HTML page.

The ASP construct  <%=userName%>  inserts the value of  userName  into HTML code.

For the specification of ASP and of VBscript, see our resource page. For examples of using scripts, see our script examples.


Built-In Objects
Dynamic-CD's ASP supports the standard ASP Built-In Objects. Additional functionality is also provided. Look here for more details about ASP Built-In Objects.
Supported Not Supported Additional features
Application Object
ObjectContext Object
Request Object
Response Object
Server Object
Session Object
ASPError Object No
No
No
Yes
Yes
No

The VBscript Error object
Error messages can be suppressed with  On Error Resume Next  and activated with  On Error Goto 0 . The Err object can be used to describe errors, for example :

    IF Err <> 0 THEN
      Response.Write "Error detected : " + Err.Description
    END IF


Other Dynamic-CD ASP features
Because Dynamic-CD's ASP is based on the VBScript engine and runs on the user's machine, Dynamic-CD's ASP provides facilities that are not supported by ASP. For example, Dynamic-CD's ASP supports such user-interface calls as  MsgBox( "Hello world")  while ASP does not (for the obvious reason that a message box cannot be shown by a browser running on a remote machine).

However, there are good reasons for using such calls ONLY for debugging purposes. Such user-interface functions interrupt the script and hence the script's response to the browser - the browser sits waiting for the script's response and will eventually give up on the request if the  MsgBox()  is not dismissed promptly.

Global.asa
Application and session events are processed by Dynamic-CD's ASP in the "global.asp" file.
(Look here for further details).

Server-Side Includes
Server-Side Includes (SSI) are script files that can be inserted into another script.
(Look here for further details).

Hiding your scripts
Script files can be encrypted and so hidden from view by using the Dynamic-CD-Wizard. Dynamic-CD automatically decrypts the file then processes the script.


© Copyright 2000-2007 PHD Computer Consultants Ltd