What Happens When a User Accesses
My ASP Page?
WordPage does all of its work during the authoring process and when you select the “Create ASP” item on the WordPage menu. At that time it generates the HTML and VBScript code that will carry out the actions you have requested. This section discusses the structure of the ASP documents that WordPage creates and how they execute when a user requests them. The general outline of the ASP document is:
Many other types of processing are possible by embedding VBScript commands in the document enclosed in curly braces {}.
If a datasource uses a generated select you have the option of allowing filters to be included in the request from the browser. The name of the filter is the field name with “_flt” appended. For example if the field is CompanyName the filter is named CompanyName_flt. The syntax is designed to be easy to supply both in a hyperlink and with an edit field in an HTML form. The results of the filter on each field are combined with an “and” operation. For information about creating filter fields click here.
The filter value is broken into its component parts. For date data semi-colons separate the parts. For all other data types the separator is a comma. Each piece is independently translated into a string that is valid as part of a SQL WHERE or HAVING clause. The results are combined with an OR operator to produce the final clause.
Each piece may begin with a comparison operator. The available operators are:
|
= |
Equals |
|
> |
Greater than |
|
< |
Less than |
|
>= |
Greater than or equal |
|
<= |
Less than or equal |
|
<> |
Not equal |
|
! |
Not equal |
If the piece has no comparison operator then it may have a range specification. Either “ to” or “…” is valid to specify a range. If the piece contains an asterisk it is regarded as a wildcard. This list shows a variety of valid request filters.
|
OrderID_flt=100 |
|
Amount_flt=>5000 |
|
OrderDate_flt=1/1/1999 to 12/31/1999 |
|
CompanyName_flt=*fish* |
|
LastName_flt=smith,jones,*son |
|
OrderID_flt=100..200,300..400,>1000 |
If the option to allow sorts in the request is checked in the datasource, WordPage allows up to five sort fields to be specified in the request. Sorts are specified similarly to filters. The syntax is Sortn=fieldname where “n” is a number from 1-5. FieldName can be prefixed by a minus sign to request a descending sort.
Here is a complete URL and an explanation of its parts:
http://localhost/test.asp?sort1=-amount&Amount_flt=>25000&companyname_flt=*ak*
|
http://localhost/test.asp |
Request the page “test.asp” from the web server named “localhost”. |
|
Sort1=-amount |
Request a descending sort by the amount field. |
|
Amount_flt=>25000 |
Only show records where the amount value is greater than 25000. |
|
Companyname_flt=*ak* |
Only show records where the company name has “ak” somewhere inside it. |