Class ScriptVariables

Provides an easy way for server code to publish strings into client script code. This object basically provides a mechanism for adding key value pairs and embedding those values into an object that is hosted on the client.

System.Object
  Westwind.Web.Controls.ScriptVariables

public class ScriptVariables : object

Class Members

MemberDescription
Constructor Full constructor that receives an instance of any control object and the client name of the generated script object that contains the specified properties.
Add Adds a property and value to the client side object to be rendered into JavaScript code. VariableName becomes a property on the object and the value will be properly converted into JavaScript Compatible text.
public void Add( string variableName,
object value );
AddClientIds Adds all the client ids for a container as properties of the client object. The name of the property is the ID + "Id" Example: txtNameId
public void AddClientIds( Control container,
bool recursive );

public void AddClientIds( Control container );

AddDynamicValue Adds the dynamic value of a control or any object's property that is picked up just before rendering.
public void AddDynamicValue( string variableName,
object control,
string property );
AddScriptAfter Any custom JavaScript code that is to immediately follow the client object declaration. This allows setting up of namespaces if necesary for scoping.
public void AddScriptAfter( string scriptCode );
AddScriptBefore Any custom JavaScript code that is to immediately preceed the client object declaration. This allows setting up of namespaces if necesary for scoping.
public void AddScriptBefore( string scriptCode );
GetItemValue
public TType GetItemValue( string key );
GetValue
public TType GetValue( string key );
AutoRenderClientScript Determines whether the output object script is rendered automatically as part of Page PreRenderComplete. If false you can manually call the RenderClientScript() method to retrieve the script and embed it yourself.
ClientObjectName The name of the object generated in client script code
UpdateMode Determines how updates to the server from the client are performed. If enabled changes to the client side properties post back to the server on a full Postback.

Requirements

Namespace: Westwind.Web.Controls
Assembly: westwind.ajaxtoolkit.dll


  Last Updated: 7/15/2008 | © West Wind Technologies, 2008