Please enable JavaScript to view this site.

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

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

public XVar BeforeShow(dynamic xt, dynamic templatefile, dynamic pageObject)

Arguments

xt

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

templatefile

a name of the template file being displayed.

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, Calendar, GANTT.

Example

You can use this event to show or hide certain elements on the page.

 

For instance, if you want to hide one button and show another one based on some condition. We will hide button with Item ID custom_buttom1 and show button with Item ID custom_button2.  

 

How to find Item ID.

 

 

 

if (Security.getUserName()=="admin") {
  pageObject.hideItem("custom_button1");
  pageObject.showItem("custom_button2");
}

Recommended sample events:

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

See also:

Template language

About templates

ASPRunner.NET templates

Choose pages screen

Creating charts

Working with common pages

Menu builder