Blame | Letzte Änderung | Log anzeigen | RSS feed
<com:TContent ID="body" ><h1 id="2201">TClientScript</h1><com:DocLink ClassPath="System.Web.UI.WebControls.TClientScript" /><h2 id="2202">Including Bundled Javascript Libraries in Prado</h2><p id="260238" class="block-content"><tt>TClientScript</tt> allows Javascript code to be insert or linked to thepage template. PRADO is bundled with a large library of Javascript functionalityincluding effects, AJAX, basic event handlers, and many others. The bundledJavascript libraries can be linked to the current page template using the<tt>PradoScripts</tt> property. Multiple bundled Javascript librariescan be specified using comma delimited string of the name of Javascript libraryto include on the page. For following example will include the "ajax" and "effects" library.</p><com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_260101"><com:TClientScript PradoScripts="ajax, effects" /></com:TTextHighlighter><p id="260239" class="block-content">The available bundled libraries included in Prado are</p><ul id="u1" class="block-content"><li><tt>prado</tt> : basic prado javascript framework based on Prototype</li><li><tt>effects</tt> : visual effects from script.aculo.us</li><li><tt>ajax</tt> : ajax and callback related based on Prototype</li><li><tt>validator</tt> : validation</li><li><tt>logger</tt> : javascript logger and object browser</li><li><tt>datepicker</tt> : datepicker</li><li><tt>colorpicker</tt> : colorpicker</li></ul><p id="260240" class="block-content">Many of the libraries, such as <tt>validator</tt> and <tt>datepicker</tt> will automaticallywhen controls that uses these libraries are visible on the page. For example, all the<a href="?page=Controls.Validation">validators</a>if they have their <tt>EnableClientScript</tt> set to true will include both the <tt>prado</tt>and <tt>validator</tt> javascript libraries.The dependencies for each library are automatically resolved. That is,specifying, say the "ajax", will also include the "prado" library.</p><h2 id="2203">Including Custom Javascript Files</h2><p id="260241" class="block-content">Custom Javascript files can be register using the <tt>ScriptUrl</tt> 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<a href="?page=Configurations.Templates3">dynamic asset tag</a>, the file "test.js" will be publishedautomatically, that is, the file will be copied to the assets directory if necessary.</p><com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_260102"><com:TClientScript ScriptUrl=<%~ test.js %> /></com:TTextHighlighter><p id="260242" class="block-content">You can include Javascript files from other servers by specifying the full URL string inthe <tt>ScriptUrl</tt> property.</p><h2 id="2204">Including Custom Javascript Code Blocks</h2><p id="260243" class="block-content"> Any content within the <tt>TClientScript</tt> control tag will be considered asJavascript code and will be rendered where it is declared.</p><div class="last-modified">$Id: ClientScript.page 1846 2007-04-07 10:35:16Z wei $</div></com:TContent>