0

I had enabled the IIS features
and follow the tutorials to build my 1st ASP.NET page
but when I run the code, this problem occer

enter image description here

but it suppose to display current time instead of @DateTime.now()
did I missed out something?

Paddy
  • 33,309
  • 15
  • 79
  • 114
Sunny
  • 477
  • 2
  • 5
  • 15
  • also please remove asp-classic from tags – Kostrzak Jan 13 '14 at 15:47
  • 1
    This is why you shouldn't use w3schools. [Their tutorial](http://www.w3schools.com/aspnet/webpages_razor.asp) lacks lots of explanation, especially on how to set things up. You [cannot use Razor in aspx pages](http://stackoverflow.com/questions/5264852/can-we-use-razor-syntax-in-asp-net-webforms-aspx-pages). Are you sure you want to learn ASP.NET Web Pages? Try [the official site](http://www.asp.net/web-pages) or take a look at [ASP.NET MVC](http://www.asp.net/mvc). – CodeCaster Jan 13 '14 at 15:56
  • ASP.NET must use RAZOR syntax? – Sunny Jan 13 '14 at 17:47

1 Answers1

0

You have to rename the file to .cshtml in order to let it be rendered as Web Page with the Razor engine. See Intro to ASP.NET Web Programming Razor Syntax : The Official Microsoft ASP.NET Site.

CodeCaster
  • 147,647
  • 23
  • 218
  • 272