summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Fundamentals/HelloWorld.page
diff options
context:
space:
mode:
authorxue <>2005-12-28 21:12:54 +0000
committerxue <>2005-12-28 21:12:54 +0000
commit3faa0d7fd4dc3442330c6037886d300412934cd1 (patch)
treee7ad161a39aec116152bc3f3f7734350b228f29a /demos/quickstart/protected/pages/Fundamentals/HelloWorld.page
parentf481e13ebf72336ed2dc90c8ec9f5d4db5b62664 (diff)
Diffstat (limited to 'demos/quickstart/protected/pages/Fundamentals/HelloWorld.page')
-rw-r--r--demos/quickstart/protected/pages/Fundamentals/HelloWorld.page25
1 files changed, 25 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/Fundamentals/HelloWorld.page b/demos/quickstart/protected/pages/Fundamentals/HelloWorld.page
new file mode 100644
index 00000000..b543afb7
--- /dev/null
+++ b/demos/quickstart/protected/pages/Fundamentals/HelloWorld.page
@@ -0,0 +1,25 @@
+<com:TContent ID="body" >
+<h1>Sample: Hello World</h1>
+<p>
+"Hello World" perhaps is the simplest <i>interactive</i> PRADO application that you can build. It displays to end-users a page with a submit button whose caption is <i>Click Me</i>. When the user clicks on the button, the button changes the caption to <i>Hello World</i>.
+</p>
+<p>
+There are many approaches that can achieve the above goal. One can submit the page to the server, examine the POST variable, and generate a new page with the button caption updated. Or one can simply use JavaScript to update the button caption upon its <i>onclick</i> event.
+</p>
+<p>
+PRADO promotes component-based and event-driven Web programming. The button is represented by a <i>TButton</i> object. It encapsulates the button caption as the <i>Text</i> property and associates the user button click action with a server-side <i>Click</i> event. Therefore, the "Hello World" task can be handled intuitively and easily. One simply needs to attach a function to the button's <i>Click</i> event. Within the function, the button's <i>Text</i> property is modified as "Hello World". The following diagram shows the above sequence,
+</p>
+<img src="<%~Samples/HelloWorld/sequence.gif%>" />
+<p>
+The code that a developer needs to write is merely the following event handler function, where <tt>$sender</tt> refers to the button object.
+</p>
+<pre class="source">
+public function buttonClicked($sender,$param)
+{
+ $sender-&gt;Text="Hello World";
+}
+</pre>
+
+<com:RunBar PagePath="Fundamentals.Samples.HelloWorld.Home" />
+
+</com:TContent> \ No newline at end of file