Scripts and Event Handlers

Scripts and Event Handlers contain all the logic and code which execute when an Event is triggered.

You can build up a flow of steps to complete what you need to do, like write to a SQL Database, get a file, navigate to a different page, call a webservice, prompt the user to make a decision (message box) and do basic IF/Else programming. Here is a list of all actions currently available in Stadium that you can use in scripts.

Scripts can be created in 3 ways:

  1. Global Scripts
  2. Scripts for specific page Load events
  3. Scripts for specific controls


Global Scripts

You define a Global script on the application level, which means it becomes available for use on multiple pages in your application.

Steps:

  1. Right-click on GlobalScripts (menu on left)
  2. Select New Script
  3. Drag actions onto the design canvas associated with the script
  4. Drag the script from the menu to the relevant page or control event's design canvas


Add a Global Script

Scripts for page load events

Drag a script onto the Load event of a specific page.

Steps:

  1. Select your page
  2. Click on Script (on top menu)
  3. Drag actions onto the design canvas associated with the script
  4. Drag the script from the menu to the relevant page's load event


Add a Script to a page's Load event


Scripts for controls

Drag a script onto an event associated with a Button, Data Grid, Image, Link, Radio Button list, Checkbox, Date Picker or Drop-down list.

Steps:

  1. Select your page
  2. Click on Script (on top menu)
  3. Drag actions onto the design canvas associated with the script
  4. Create an event for your control (e.g. ButtonClick event)
  5. Drag the script from the menu to the control's event
You can also create an event handler for a control in this way.


Script Properties

  1. Input Parameters

    The parameters that will be passed to the script when calling it.
  2. Output Parameters

    The parameters that will be returned by the script.