[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/demos/quickstart/protected/pages/Controls/ -> ClientScript.page (source)

   1  <com:TContent ID="body" >
   2  
   3  <h1 id="2201">TClientScript</h1>
   4  <com:DocLink ClassPath="System.Web.UI.WebControls.TClientScript" />
   5  <h2 id="2202">Including Bundled Javascript Libraries in Prado</h2>
   6  <p>
   7  <tt>TClientScript</tt> allows Javascript code to be insert or linked to the
   8  page template. PRADO is bundled with a large library of Javascript functionality
   9  including effects, AJAX, basic event handlers, and many others. The bundled
  10  Javascript libraries can be linked to the current page template using the
  11  <tt>PradoScripts</tt> property. Multiple bundled Javascript libraries
  12  can be specified using comma delimited string of the name of Javascript library
  13  to include on the page. For following example will include the "ajax" and "effects" library.
  14  </p>
  15  <com:TTextHighlighter Language="prado" CssClass="source">
  16  &lt;com:TClientScript PradoScripts="ajax, effects" /&gt;
  17  </com:TTextHighlighter>
  18  
  19  <p>
  20      The available bundled libraries included in Prado are
  21      <ul>
  22          <li><tt>prado</tt> : basic prado javascript framework based on Prototype</li>
  23          <li><tt>effects</tt> : visual effects from script.aculo.us</li>
  24          <li><tt>ajax</tt> : ajax and callback related based on Prototype</li>
  25          <li><tt>validator</tt> : validation</li>
  26          <li><tt>logger</tt> : javascript logger and object browser</li>
  27          <li><tt>datepicker</tt> : datepicker</li>
  28          <li><tt>rico</tt> : Rico library</li>
  29          <li><tt>colorpicker</tt> : colorpicker</li>
  30      </ul>
  31  </p>
  32  <p>The dependencies for each library are automatically resolved. That is,
  33      specifying, say the "ajax", will also include the "prado" library.</p>
  34  
  35  <h2 id="2203">Including Custom Javascript Files</h2>
  36  <p>Custom Javascript files can be register using the <tt>ScriptUrl</tt> property.
  37  The following example includes the Javascript file "test.js" to the page. In this case, the file
  38  "test.js" is relative the current template you are using. Since the property value is
  39  <a href="?page=Configurations.Templates3">dynamic asset tag</a>, the file "test.js" will be published
  40  automatically, that is, the file will be copied to the assets directory if necessary.
  41  </p>
  42  <com:TTextHighlighter Language="prado" CssClass="source">
  43  &lt;com:TClientScript ScriptUrl=&lt;%~ test.js %&gt; /&gt;
  44  </com:TTextHighlighter>
  45  <p>You can include Javascript files from other servers by specifying the full URL string in
  46      the <tt>ScriptUrl</tt> property.</p>
  47  
  48  <h2 id="2204">Including Custom Javascript Code Blocks</h2>
  49  <p> Any content within the <tt>TClientScript</tt> control tag will be considered as
  50      Javascript code and will be rendered where it is declared.</p>
  51  
  52  </com:TContent>


Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7