ASP 3.0 examples

Do not run this file locally
Run it from your (local) web server where is installed IIS and ASP 3.0.

The ASP service program must have write access to Examples/Asp/Database.mdb file
To permit write access on Windows XP right click to file Database.mdb in My Computer, select Properties -> Security -> Users and set Full control to Allow. If you don't have Security item in Properties, run My Computer, in menu select Tools - > Folder options -> View and uncheck Use simple file sharing option.
In Windows Vista for access MDB files you have to permit write access to folder C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp for user IUSR. Remember, some folders in path are hidden. This is common Windows Vista problem with running old ASP scripts.

Visual Basic


Ajax

Asynchronous background (new style) communication with server.
Data are downloaded from or uploaded to server by JavaScript XmlHttpRequest object on background, without reloading/submitting the page content.
You can check from configuration menu option Auto update changes to server for immediate updates after edit/modify.
When debugging, you can set <treegrid ... Debug='3' ... > to see communication with server. It opens two new browser's windows. You can see XML data or ASP error server returned.
Remember, in Ajax communication, the asp page must return only xml data, not any standard html tags like <html> or <!doctype>.
See documentation AJAX versus submit and also tutorial Identifying rows when uploading.

Ajax table
Main file AjaxTable.html, support code AjaxTable.asp
Layout file in TableDef.xml, data in database table "TableData".
The simplest demonstration of using ASP and AJAX. It generates data from database table 1:1 including id. Also updates changes to database according/with id.

Ajax table with framework
Main file AjaxTableFramework.html, support code AjaxTableFramework.asp, framework code TreeGridFramework.asp
Layout file in TableDef.xml, data in database table "TableData".
The same example as previous Ajax table but with using functions from TreeGrid ASP Framework. Also shows using user parameters.

Ajax table with server side paging and export
Main file AjaxTablePaging.html, support codes AjaxTablePaging.asp , AjaxTablePagingPage.asp , AjaxTablePagingExport.asp
Layout file in TableDef.xml, data in database table "TableData".
The same example as previous Ajax table but with using server paging and export routine.
The pages are downloaded on demand from server (when the page is visible by scrollbars).
It is simple example with ineffective database access - it loads all table for every page and throws the rest away.
It also simply reloads all body when rows are added or deleted instead of handling changes in pages.

Ajax tree with framework
Main file AjaxTreeFramework.html, support code AjaxTreeFramework.asp, framework code TreeGridFramework.asp
Layout file in TreeDef.xml, data in database table "TreeData".
Generates treetable from database table with column Parent where are relations Parents/Children. Parent column contains parent's id of the child. For root rows it contains "#Body", for fixed rows "#Head" or "#Foot".
Uploaded rows are still identified by preset and standardly generated id attributes.
Uses functions from TreeGrid ASP Framework.

Ajax Extended API with reloading
Main file AjaxAPI.html, support codes AjaxTableFramework.asp and AjaxTreeFramework.asp , framework code TreeGridFramework.asp
Layout files in TableDef.xml and TreeDef.xml, data in database tables "TableData" and "TreeData".
It shows two tables from previous examples and demonstrates Extended API functions for reloading, changing data source when reloading, catching data event and so on.

Ajax grid
Main file AjaxGrid.html, support codes AjaxGridData.asp , AjaxGridLayout.asp , AjaxGridUpload.asp
Data in database table "TableData".
Demonstrates advanced generating from and updating to database.
Generates treetable from standard database table. Also flips the table and shows data in changed layout.
For every action is used another support code (Layout, Data, Upload). The layout is also generated.
Rows are identified by one unique editable column, with using full ids (including parents ids).
For demonstration it shows id column, to see what ids are generated by TreeGrid.

Complete application - Schools
Main file Schools.html
Support codes Schools.asp (main file generates data and also saves changes to database or adds new user),
SchoolsRatings.asp (loads reviews for given record, used for server child paging),
SchoolsReview.asp (saves one review to database, called as custom AJAX call).
Layout file in SchoolsDef.xml, data in database tables "Schools_Schools", "Schools_Ratings" and "Schools_Users".
Uses also file SchoolsStars.gif ()
Complete application to demonstrate generating from and updating to different database tables with various structure. Demonstrates also server child paging feature (loading children on demand). And also custom AJAX call.
The application show list of schools that can be sorted and filtered. The records can be added/deleted or modified by logged user or admin. The records can be rated and reviewed by visitors.



Submit

Synchronous (old style) communication with server.
Data are included in page in hidden input. Changes are sent to server in the hidden input of submitted <form> on page.
See documentation AJAX versus submit and also tutorial Identifying rows when uploading.

Submit table
Main file SubmitTable.asp
Layout file in TableDef.xml, data in database table "TableData".
The simplest demonstration of using ASP and standard page submit. It generates data from database table 1:1 including id. Also updates changes to database according/with id.
The code is nearly the same as in Ajax table.

Submit table with framework
Main file SubmitTableFramework.asp, framework code TreeGridFramework.asp
Layout file in TableDef.xml, data in database table "TableData".
The same example as previous Submit table but with using functions from TreeGrid ASP Framework.

Submit tree with framework
Main file SubmitTreeFramework.asp, framework code TreeGridFramework.asp
Layout file in TreeDef.xml, data in database table "TreeData".
Generates treetable from database table with column Parent where are relations Parents/Children. Parent column contains parent's id of the child. For root rows it contains "#Body", for fixed rows "#Head" or "#Foot".
Uploaded rows are still identified by preset and standardly generated id attributes.
Uses functions from TreeGrid ASP Framework.
The code is nearly the same as in Ajax tree.