When I create a new Razor page in Visual Studio 2017, the separated code behind file did not get created.
This is the screenshot of the problem highlighted.

We can see the Razor page called List.cshtml does not contain the code behind file. Contrast that with the default page about.cshtml, for example.