summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Fundamentals/Controls.page
diff options
context:
space:
mode:
authorxue <>2005-12-29 11:52:31 +0000
committerxue <>2005-12-29 11:52:31 +0000
commit658a7e1c4cf5a53dcd61ee196658090d00f2d64a (patch)
treec37b767c6e4d70baaf9ff471ce3721c9d8733f72 /demos/quickstart/protected/pages/Fundamentals/Controls.page
parentc0006cf0da8c3499060df7378cc376c98cbce7c4 (diff)
Used THighlighter to show code fragments.
Diffstat (limited to 'demos/quickstart/protected/pages/Fundamentals/Controls.page')
-rw-r--r--demos/quickstart/protected/pages/Fundamentals/Controls.page16
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-&gt;getViewState('Name',$defaultValue);
-$this-&gt;setViewState('Name',$value,$defaultValue);
-$this-&gt;getControlState('Name',$defaultValue);
-$this-&gt;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>