diff options
Diffstat (limited to 'demos/quickstart/protected/pages/Fundamentals/Controls.page')
-rw-r--r-- | demos/quickstart/protected/pages/Fundamentals/Controls.page | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/demos/quickstart/protected/pages/Fundamentals/Controls.page b/demos/quickstart/protected/pages/Fundamentals/Controls.page index cc0b3eda..a90dd604 100644 --- a/demos/quickstart/protected/pages/Fundamentals/Controls.page +++ b/demos/quickstart/protected/pages/Fundamentals/Controls.page @@ -10,10 +10,10 @@ Controls are related to each other via parent-child relationship. Each parent co </p>
<p>
The parent-child relationship is usually established by the framework via <a href="?page=Configurations.Templates1">templates</a>. In code, you may explicitly specify a control as a child of another using one of the following methods,
-<pre class="source">
+<com:TTextHighlighter CssClass="source">
$parent->Controls->add($child);
$parent->Controls[]=$child;
-</pre>
+</com:TTextHighlighter>
where the property <tt>Controls</tt> refers to the child control collection of the parent.
</p>
@@ -39,12 +39,12 @@ PRADO borrows the viewstate and controlstate concept from Microsoft ASP.NET to p </p>
<p>
Viewstate and controlstate are implemented in <tt>TControl</tt>. They are commonly used to define various properties of controls. To save and retrieve values from viewstate or controlstate, use following methods,
-<pre class="source">
-$this->getViewState('Name',$defaultValue);
-$this->setViewState('Name',$value,$defaultValue);
-$this->getControlState('Name',$defaultValue);
-$this->setControlState('Name',$value,$defaultValue);
-</pre>
+<com:TTextHighlighter CssClass="source">
+$this->getViewState('Name',$defaultValue);
+$this->setViewState('Name',$value,$defaultValue);
+$this->getControlState('Name',$defaultValue);
+$this->setControlState('Name',$value,$defaultValue);
+</com:TTextHighlighter>
where <tt>$this</tt> refers to the control instance, <tt>Name</tt> refers to a key identifying the persistent value, <tt>$defaultValue</tt> is optional. When retrieving values from viewstate or controlstate, if the corresponding key does not exist, the default value will be returned.
</p>
|