/movies does nothing, just does not load.
Followed all instructions up to the heading "Test the app" where appending "/movies" to the URL does nothing. After 3-4 minutes the browser gives up.
Out of interest, I would like to know where to look to see where the routing is handled? Where would the instruction for "/movies" be handled? Should it throw an error message if there is nothing to load?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 6719f08e-3bd7-dc1a-71df-f2ef9fbca9d8
- Version Independent ID: 7096fdb3-612e-9e00-bd0b-8ea4886a09ce
- Content: Add a model to a Razor Pages app in ASP.NET Core
- Content Source: aspnetcore/tutorials/razor-pages/model.md
- Product: aspnet-core
- GitHub Login: @Rick-Anderson
- Microsoft Alias: riande
You should have a Pages\Movies\Index.cshtml that starts out like:
@page
@model RazorPagesMovie.Pages.Movies.IndexModel
@{
ViewData["Title"] = "Index";
}
You might want to compare you code to the sample download.
You could read about routing but your probably better off finding your mistake - probably Movies spelled differently.
You Added Scaffold in the root of project . you should create the movies Folder inside the Pages Folder .
i have found the solution while scaffolding the project, the scaffolding was unable to find the Movies folder. Change it to below. Use backslash instead of forward slash. Before excuting the below command, you may want to create a Movies folder first inside your Pages folder. I am using VS code.
dotnet aspnet-codegenerator razorpage -m Movie -dc RazorPagesMovieContext -udl -outDir Pages/Movies --referenceScriptLibraries
The VSC instructions are correct. Did you follow the wrong instructions?