Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > Page class > Methods

setProxyValue

Scroll Prev Next More

 

Sets the variable to the given value. Use the setProxyValue() method to pass ASP values to JavaScript: you assign value to a variable in ASP and then use it in JavaScript.

 

This method is available on all pages.

Syntax

 

setProxyValue(name, value)

Arguments

name

any variable name. Example: "master".

value

the value assigned to the variable. value may be a simple value (e.g., string, number) or an array.

Return value

No return value.

Example 1

Setting and using regular variables and arrays:

 

pageObject.setProxyValue("name", "some value")
pageObject.setProxyValue("master",pageObject.getMasterRecord())

 

Use the name and master variables in JavaScript OnLoad event:

 

alert(proxy['name']);
alert(proxy.master['Make']);

Example 2

Using ASP values in button's Javascript code.

 

BeforeDisplay event:
 

 

pageObject.setProxyValue("name", "some value")

 

 

 

Javascript OnLoad event:

 

window.proxy = proxy;

 

Button's ClientBefore or ClientAfter event

 

alert(window.proxy['name']);

See also:

RunnerPage class: getMasterRecord()

Event: AfterAdd

Event: AfterEdit

Event: JavaScript OnLoad

Example: How to display any page in a popup window

About RunnerPage class