Hello World Example
Step 1: Folder Creation
Create a new sub folder named HelloWorld
under the Sodium-Site\apps
folder of the installation path.
Step 2: Control File
Controller File: Create a file named controller.sqlx
. It will be empty. For more information about controller file.
Step 3: Form File
Form File: Create a file named HelloWorld.frmx
and copy/paste the code block showed below into the file.
Form File Explanation:
It is a plain html file. The only difference is a
controlblock
tag on the lines between 14 and 19 with a namecontrol-block-name="cbDemo"
. For more information on control blocks, please follow the link Control Block.There is nothing special about the input tag in the control block. For more information on buttons, please follow the link Button Item.
Step 4: Code Behind File
Code behind File: Create a file named HelloWorld.sqlx
and copy/paste the code block showed below into the file.
Code behind Explanation:
Each form file must have a code behind file in the same directory. Code behind files has the same name but with
sqlx
extension. For more information on Code Behind files, please follow the link Code Behind File.In the "page_load" trigger, message function is used in order to show a message on the client browser.
Output
In order to open page, write the form file path into the address bar of the Internet browser (http://localhost:8089/Sodium-Site/apps/helloworld/helloworld.frmx). After each file request, "Page loaded" will be shown. After click on "Say Hello World" button, "Hello World" message will be shown on four times with different style.
Video
Last updated
Was this helpful?