Knowledge Essentials - 3Essentials Hosting

ASP.net 2.0 Hello World sample code

Article ID: 1077

 Back to Search

The following is a basic ASP.net 2.0 sample code, "Hello World!" style sample... simply place this code into a single file on your site (i.e. test.aspx):

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server"> 
    protected void Page_Load(object sender, EventArgs e)
    {
       Label1.Text = "Hello World!";
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    </div>
    </form>
</body>
</html>

 
Downloads Associated With This Article
No downloads are currently associated with this article.