Home » Development » Sample ASP.NET page to test IIS functionality

Sample ASP.NET page to test IIS functionality

If you want to test ASP.NET functionality in a web server, feel free to use the code below. This is the easiest way of making sure IIS can render ASPX pages.

  1. Open Notepad
  2. Copy the code below into the Notepad file
  3. Save it as test.aspx
<%@ Page Language="c#" AutoEventWireup="false" %>
<%
    HelloWorldLabel.Text = "Hello, world!";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Test Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:Label runat="server" id="HelloWorldLabel"></asp:Label>
    </div>
    </form>
</body>
</html>

One of the common issues I see with ASP.NET pages is the “404 Page Not Found” error even though the page exists. Here is the solution for this issue: ASP.NET pages display 404 error even though they exist

Ned Sahin

Blogger for 20 years. Former Microsoft Engineer. Author of six books. I love creating helpful content and sharing with the world. Reach me out for any questions or feedback.

Leave a Comment