Let’s take a quick look at a simple Hello world program in ASP.NET.
1. Drag a Label control, from the Standard toolbox
2. to the Web form (see the screenshot below)
3. Reach to the Text attribute from the control panel
4. Type Hello Work in the box (see the screenshot below)
Here is what the result would look like on the web form
Tip: Auto Hide is clicked for the Toolbox to stay and not hide when we take the cursor off the Toolbox panel.
You can switch to Source view and you will see the Hello World Label generated for you.
Note: in the rest of this tutorial I will simply show the source code this like the one above, you can copy and paste the code in the Source view or use the drag-drop approach. Although the drag-drop approach seems easy, however there are things that can only (or easily) be done via code.
Save the file (Ctrl+S)
Run to preview the web form in web browser by clicking the run button or press F5 to
Being a new web project, this box may pop-up box, prompting you to click Ok to enable debugging; click Ok to enable…. This will help Visual Studio to report bug or error during the running of your web project.
The preview of Default.aspx in browser