TClientScript

Including Bundled Javascript Libraries in Prado

TClientScript allows Javascript code to be insert or linked to the page template. PRADO is bundled with a large library of Javascript functionality including effects, AJAX, basic event handlers, and many others. The bundled Javascript libraries can be linked to the current page template using the PradoScripts property. Multiple bundled Javascript libraries can be specified using comma delimited string of the name of Javascript library to include on the page. For following example will include the "ajax" and "effects" library.

<com:TClientScript PradoScripts="ajax, effects" />

The available bundled libraries included in Prado are

The dependencies for each library are automatically resolved. That is, specifying, say the "ajax", will also include the "prado" library.

Including Custom Javascript Files

Custom Javascript files can be register using the ScriptUrl property. The following example includes the Javascript file "test.js" to the page. In this case, the file "test.js" is relative the current template you are using. Since the property value is dynamic asset tag, the file "test.js" will be published automatically, that is, the file will be copied to the assets directory if necessary.

<com:TClientScript ScriptUrl=<%~ test.js %> />

You can include Javascript files from other servers by specifying the full URL string in the ScriptUrl property.

Including Custom Javascript Code Blocks

Any content within the TClientScript control tag will be considered as Javascript code and will be rendered where it is declared.

$Id$