A Simple Web Page

ASP.NET still supports the ASP model of programming Web pages. The most striking difference a seasoned ASP programmer may notice right away is that VBScript has been replaced by Visual Basic.NET, JScript.NET, and C#. As expected, all ASP.NET code in this chapter is written in C#. Just to get started, take a look at the code in Listing 20.1. It is a very simple Web page, printing the phrase, “Howdy, Partner!” to the browser screen.

Listing 20.1. A Simple ASP.NET Web Page: howdy.aspx
<%@ Page Language="C#" Description="Print Howdy, Partner!" %>
<html>
    <body>
        <%
            Response.Write("Howdy, Partner!");
        %>
    </body>
</html>

To view the page in Listing 20.1, simply point a browser at the location of the howdy.aspx file. The first line ...

Get C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.