Please enable JavaScript to view this site.

ASPRunnerPro 10.2 Manual

Navigation: Advanced topics > Events

PHPrunner32x32     ASPRunnerPro manual


Page life cycle overview

Scroll Prev Next More

 

When a ASPRunnerPro-generated page runs, the page goes through a life cycle in which it performs a series of processing steps. These include initialization, retrieving data, instantiating controls and rendering. It is important to understand the page life cycle so that you can write code at the appropriate life-cycle stage for the effect you intend.

Global Events

AfterAppInit

 

Occurs in the beginning of each page before any processing takes place. Use this event to override any global ASPRunnerPro variables. See help area in Event editor for the list of available global variables.

AfterTableInit

 

Occurs in the beginning of each page before any processing takes place, right after AfterAppInit. Use this event to override any table-specific ASPRunnerPro variables. See help area in Event editor for the list of available table variables.

ModifyMenuItem

 

This event will be executed for each Menu item before a page is displayed in the browser. Use this event to modify or hide menu items.

 

List/Print pages

BeforeProcessList

BeforeProcessPrint

 

Occurs when page processing starts and database connection is established.

Use this event for the following:

- change database connection to point to another database

- read request data and populate session variables

- redirect to another page

BeforeDelete

This event will be executed once for each record to be deleted.

Use this event for the following:

- prevent a record from being deleted

- save deleted record in another table

AfterDelete

Occurs once for each record after it was deleted

AfterMassDelete

Occurs after bulk delete operation

BeforeProcessRowList

BeforeProcessRowPrint

Occurs after database record is retrieved from the database before formatting is applied.

Use this event for the following:

- modify value of any column

- prevent certain records from being displayed on the page

- calculate/display your own totals and subtotals

BeforeMoveNextList

BeforeMoveNextPrint

Occurs after database record is retrieved from the database and formatting is applied.

Use this event for the following:

- display an empty row or a header between group of records.

- apply additional formatting to any column

BeforeShowList

BeforeShowPrint

Occurs after page is processed and ready to be displayed in the browser.

Use this event for the following:

- define a new template variable or change the value of existing one

- display different template

OnPageLoad

Occurs after page is displayed in browser. Use this event to work with the "edit" controls using the Javascript API.

Edit/Add pages

BeforeProcessEdit

BeforeProcessAdd

Occurs after page is processed and ready to be displayed in the browser.

Use this event for the following:

- define a new template variable or change the value of existing one

- display different template

BeforeEdit

BeforeAdd

Occurs before new data is written to the database. Will work in all add/edit modes: Inline Add/Edit, Regular Add/Edit and Add/Edit page in popup.

Use this event for the following:

- prevent data record from being added or edited

- send an email

- save old record in another table

- add a record to the log table

AfterEdit

AfterAdd

Occurs after data was written to the database. Will work in all add/edit modes: Inline Add/Edit, Regular Add/Edit and Add/Edit page in popup.

Use this event for the following:

- send an email

- add a record to the log table

ProcessValuesEdit

Occurs before the record is displayed (before the BeforeShowEdit event).

BeforeShowEdit

BeforeShowAdd

Occurs after page is processed and ready to be displayed in the browser.

Use this event for the following:

- define a new template variable or change the value of existing one

- display different template

OnPageLoad

Occurs after page is displayed in browser. Use this event to work with the "edit" controls using the Javascript API.

Login/Registration pages

BeforeProcessLogin

BeforeProcessRegister

Occurs after page is processed and ready to be displayed in the browser.

Use this event for the following:

- define a new template variable or change the value of existing one

- display different template

BeforeLogin

BeforeRegister

Occurs before user logs in or new user data is written to the database.

Use this event for the following:

- prevent user from being logged in or registered

- send an email

- add a record to the log table

AfterSuccessfulLogin

AfterSuccessfulRegistration

Occurs after user is logged in or registered successfully.

Use this event for the following:

- redirect user to another page

- send an email

- add a record to the log table

AfterUnsuccessfulLogin

AfterUnsuccessfulRegistration

Occurs if user was not logged in or was not registered.

 

BeforeShowLogin

BeforeShowRegister

Occurs after page is processed and ready to be displayed in the browser.

Use this event for the following:

- define a new template variable or change the value of existing one

- display different template

OnPageLoad

Occurs after page is displayed in browser. Use this event to work with the "edit" controls using the Javascript API.

View/Search/Report/Chart pages

BeforeProcess<PageName>

Occurs after page is processed and ready to be displayed in the browser.

Use this event for the following:

- define a new template variable or change the value of existing one

- display different template

ProcessValuesView

Occurs before the record is displayed (before the BeforeShowView event).

BeforeShow<PageName>

Occurs after page is processed and ready to be displayed in the browser.

Use this event for the following:

- define a new template variable or change the value of existing one

- display different template

OnPageLoad

Occurs after page is displayed in browser. Use this event to work with the "edit" controls using the Javascript API.

Import page

BeforeImport

This event is executed before import is started.

BeforeInsert

Occurs before a record is inserted. Use this event to modify the record before it is inserted.

AfterImport

This event is executed after import is finished.