From 9be8859d92e4bbec2462e82457d014f0a0d720db Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 26 Dec 2005 15:54:54 +0000 Subject: --- .../protected/pages/Samples/HelloWorld.page | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 demos/quickstart/protected/pages/Samples/HelloWorld.page (limited to 'demos/quickstart/protected/pages/Samples/HelloWorld.page') diff --git a/demos/quickstart/protected/pages/Samples/HelloWorld.page b/demos/quickstart/protected/pages/Samples/HelloWorld.page new file mode 100644 index 00000000..98d29265 --- /dev/null +++ b/demos/quickstart/protected/pages/Samples/HelloWorld.page @@ -0,0 +1,26 @@ + +

Sample: Hello World

+

+"Hello World" is the simplest interactive PRADO application that you can build. It displays to end-users a page with a submit button whose caption is Click Me. When the user clicks on the button, the button changes the caption to Hello World. +

+

+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 onclick event. +

+

+PRADO promotes component-based and event-driven Web programming. The button is represented by a TButton object. It encapsulates the button caption as the Text property and associates the user button click action with a server-side Click event. Therefore, the "Hello World" task can be handled intuitively and easily. One simply needs to attach a function to the button's Click event. Within the function, the button's Text property is modified as "Hello World". The following diagram shows the above sequence, +

+ +

+The code that a developer needs to write is merely the following event handler function, where $sender refers to the button object. +

+
+public function buttonClicked($sender,$param)
+{
+	$sender->Text="Hello World";
+}
+
+
+Run Sample +View Source +
+
\ No newline at end of file -- cgit v1.2.3