0

I've started the w3 asp.net tutorial and I've fallen at the first hurdle.

The first example in the tutorial is:

<html>
<body>
     <h1>Hello Web Pages</h1>
     <p>The time is @DateTime.Now</p>
</body>
</html>

This outputs @DateTime.Now as @DateTime.Now

If I change the code to:

<html>
<body>
     <h1>Hello Web Pages</h1>
     <p>The time is <%= DateTime.Now %></p>
</body>
</html>

This outputs the date and time.

I'm running IIS 10 on windows 10. I'm not using VS or VS Code, just a text editor so I can concentrate on the language and not get bogged down by the IDE.

Is there some IIS setting I need to enable to make the @syntax work or is there something I need to install? Is there something that needs to go into the web config file?

Completely new to ASP.NET - can someone help me out here please.

Graham
  • 7,807
  • 20
  • 69
  • 114

0 Answers0