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.
- Open Notepad
- Copy the code below into the Notepad file
- 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