OnPageRedirect Event

Description

This event fires just before a page redirect occurs after data has been submitted (without errors.)

Discussion

This event can be used to dynamically compute the target page to open on redirect.

This event will only fire if the 'Target Page' property in the 'Update Settings' pane is set to: <Event>

This event must set the e.URL property. The e.URL property is redirect's target URL.

Variable
Description
e.url

The redirect URL.

Examples 

Redirect to another page in your application:

e.url = "page1.a5w"

Redirect to Google.

e.url = "http://www.google.com"

Redirect to a page with page variables set using values in the current grid. This example sets the page variables "firstname" and "lastname" to the value of the firstname and lastname fields in row 1 of the Grid:

e.url = "page1.a5w?firstname=" + Request.Variables.v.r1.firstname + "&lastname=" + Request.Variables.v.r1.lastname

Redirect to a page with page variables set using values in a new record. This example sets the page variables "firstname" and "lastname" to the value of the firstname and lastname fields in the first row of new records in the Grid:

e.url = "page1.a5w?firstname=" + Request.Variables.v.r_1.firstname + "&lastname=" + Request.Variables.v.r_1.lastname

Setting State Variables 

You can also set state variables in this event. The value of any state variables will be available in all subsequent ajax callbacks (in the e.__si2 object).

To set a state variable:

e._state.myvar1 = "value1"
e._state.myvar2 = "value2"