ASP.NET/Your First Page

Your First ASP.NET Page

No programming book is complete without a Hello World example as the first project/example.

In ASP.NET creating a quick Hello World example is painless and easy. At the same time we are going to explore the structure of a basic ASP.NET page.

Let's look at the basic structure of an ASP.NET page. Doing so will give us a chance to introduce several important aspects relevant to coding ASP.NET pages.


<%@ Page Language="VB" %>


<%@ Page Language="C#" debug="true" trace="false"%>

As you can see, an ASP.NET page has a lot in common with a regular HTML-based page. Now in order to make our Hello World example we just need to add one line of code to the above examples.


      Sub Page_Load()
        'On Page Load Run this code
        Response.Write ("Hello World")
      End Sub


      void Page_Load() {
        //On Page Load Run this Code
        Response.Write("Hello World");

Copy the original code into a new file with the extension aspx. Then make the above modification. When the file is run, assuming it is being hosted on an ASP.NET compatible web server, you will see the words Hello World on your web browser when you access the page.

Next Chapter: Examining The Page Structure

This article uses material from the Wikipedia page available here. It is released under the Creative Commons Attribution-Share-Alike License 3.0.


Manage research, learning and skills at IT1me. Create an account using LinkedIn to manage and organize your IT knowledge. IT1me works like a shopping cart for information -- helping you to save, discuss and share.

  Contact Us  |  About |  IT Training & References |  IT Careers |  IT Hardware |  IT Software |  IT Books