So does the new ASP.NET web pages (also called razor pages) framework using the Razor view engine (referring to this: http://www.asp.net/webmatrix/tutorials/1-getting-started-with-webmatrix-and-asp-net-web-pages) not actually have any code-behind file? I looked on the samples and couldn’t find an example. I assume no, but maybe there is a header reference where you can link it that I might be missing?
Can anyone confirm?
Thanks.
There are no code behind files for Razor Views because you don’t need them. You are writing the presentation logic using the Razor syntax on the view itself.
Razor views simplifies the mixing of raw HTML with dynamic content rendered using Razor syntax so you don’t need a separate file. Furthermore there are no such things as
ControlsorComponentsin razor views so you don’t need to configure them in a separate file.