The absolute minimum code in 1 aspx file that wakes .NET.

What would you write as an absolute minimum for writing an aspx file? The goal is to get the .net handler to start. Sometimes I want to make short code to test iis functionality. It is easy in old languages.
HTML
Hello world

ASP
<% Response.Write("Hello World") %>

ASP.NET
It works fine, but so awkward - yes.

 <%@ Page Language="C#" %> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { Response.Write("Hello World!"); } </script> 

System.Environment.Version is good, though, if you also check the version. Is this code really needed for asp.net? This is not a code that you simply "manually print, just for verification."

+6
source share
3 answers

There is an absolute minimum or can be interpreted as:

 <%@ Page Language="C#" %> <% Response.Write("test"); %> 
+5
source

Rob, Could it be lower?

 protected void Page_Load(object sender, EventArgs e) { Response.Write("Hello World!"); } 

Like ASP> net tag

0
source

if the goal is to run the .net handler, a minimal empty file with the aspx extension .
Page Language = "C #" is not required since C # is the default language.

0
source

Source: https://habr.com/ru/post/887907/


All Articles