Hello World ASP style

Before you can head into the ASP world, you will first need to install a webserver. This is quite easy, you just pop up the ol’ Control Panel in Windows, select Program & Features, and select “Turn Windows features on or off”. When this is done, you find and tick the box for “Internet Information Services”. Expand the list under IIS(Internet Information Services), expand “World Wide Web Services” and again expaned “Application Development Features”,  while in this view make sure you tick of the box for “ASP” and “ASP.Net”.

IIS Config

You should have a new folder on your system drive called C:\Inetpub\wwwroot\ were you can now save webpages which you can access by opening your fav web browser and entering http://localhost/ . if you do this, you will get the IIS welcome page! Yeeey.

We want to make our own webpages so add a new textfile to wwwroot which you call  c:\Inetpub\wwwroot\HelloWorld.aspx this file can be accessed by http://localhost/HelloWorld.aspx in your web browser. Open your fav text editor and edit the HelloWorld.aspx and add the following code:

<%@ Page Language = "C#" %>
<script runat = "server">
  protected void Page_Load(object sender, EventArgs e){
    lblMsg.Text = "This page is made by Author: Me!";
  }
</script>
<html>
<head>
  <title>My World!</title>
</head>
<body>
  <asp:Label id = "lblMsg" runat ="server" />
</body>
</html>

The output would then be:

This page is made by Author: Me! 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s