Slide 10.b: Microsoft ASP.NET
Slide 10.d: Writing your first ASP.NET page
Home

ASP.NET Web Pages


A simple ASP.NET page looks just like an ordinary HTML page.

Hello, World in HTML

Hello, World!


An HTML page displaying “Hello, World!” in a browser is shown on the above. The HTML script for the example is given on the right.
FirstPage.html
 <html>
   <body bgcolor="#EDF3FE">
     <center>
       <h3>Hello, World!</h3>
     </center>
   </body>
 </html>

Hello, World in ASP.NET

Hello, World!


The simplest way to convert an HTML page into an ASP.NET page is to copy the HTML file to a new file with an .aspx extension. The ASP.NET script for the example is given on the right.
FirstPage.aspx
 <html>
   <body bgcolor="#EDF3FE">
     <center>
       <h3>Hello, World!</h3>
     </center>
   </body>
 </html>

How Does It Work?
Fundamentally an ASP.NET page is just the same as an HTML page. An HTML page has the extension .htm. If a browser requests an HTML page from the server, the server sends the page to the browser without any modifications. An ASP.NET page has the extension .aspx. If a browser requests an ASP.NET page, the server processes any executable code in the page, before the result is sent back to the browser. The ASP.NET page above does not contain any executable code, so nothing is executed.