Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Global events > Login page

PHPrunner32x32     ASPRunnerPro manual


Event: Before Display

Scroll Prev Next More

Description

The Before Display event is executed right before a page is displayed in the browser. Use this event to modify the value of any template variable or to define a new one.

Syntax

BeforeShow(xt, pageObject)

Arguments

xt

a template engine object. Use xt.assign "name", "val" to assign a value val to the variable name.

pageObject

an object representing the current page. For more information, see RunnerPage class.

Applies to pages

List, Add, Print, Search, Export, Report, Chart, Login, Register, Password reminder, Change password, Menu.

Example

To display some text on the List page:

 

1. Proceed to the Editor page.

 

2. Switch to HTML mode and find the line {END container_recordcontrols}. Add the following code right before it:

 

<DIV>{$sample_code}</DIV>

 

3. Add the following code to the BeforeDisplay event.

 

Note: Change red values to match your project.

 

dim str
str="<b>Today is </b><i>" & FormatDateTime(now(),1) & " " & _
  FormatDateTime(now(),3) & "</i>"
xt.assign "sample_code",str

Recommended sample events:

Hide controls on Add/Edit pages, based on logged user name

See also:

Template language

About templates

ASPRunnerPro templates

Choose pages screen

Creating charts

Working with common pages

Menu builder