RAD Studio for Microsoft .NET |  |

Building an ASP.NET "Hello World" Application
See Also
Collapse All

Though simple, the ASP.NET "Hello World" application demonstrates the essential steps for creating an ASP.NET application. The application uses a Web Form, controls, and an event that will display a result in response to a user action.

To create an ASP.NET project

1. Create a new ASP.NET project by clicking FileNewASP.NET Web Application. The New ASP.NET Web Application dialog box appears.
2. In the Name field, enter HelloWorld for the application name.
3. In the Location field, accept the default or enter another path.

To change Web server settings (optional)

1. In the New ASP.NET Web Application dialog box, click View Server Options. The dialog expands to show additional server options.
2. Set the various read and write attributes of the project as needed or accept the defaults.
   Tip: For most ASP.NET projects, the default settings will suffice.
3. Click OK. The Web Forms Designer appears.

To create the ASP.NET page

1. If necessary, click Design view.
2. From the Web Controls category of the Tool Palette, drag a Button component onto the Designer surface. The Button control appears on the Designer. Make sure the control is selected.
3. In Object Inspector, set the Text property to Hello, world!.

To associate code with the button control

1. In the Designer, double-click the Button control. The code-behind Designer appears, cursor in place between event handler brackets.
2. Code the application logic:

Copy Code

    button1.Text = "Hello, developer!";

Copy Code

    button1.Text := 'Hello, developer!';

1. Choose FileSave to save the application.

To run the "Hello World" application

1. Choose RunRun. The application compiles and the HTTP server displays a Web Form in your default browser with the "Hello, world!" button.
2. Click the "Hello, world!" button. The server updates the page with the response, "Hello, developer!".
3. Close the Web browser to return to the IDE.

See Also

ASP.NET Overview

Building an ASP.NET application

Building an ASP.NET database application

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!