Skip to content

Change navbar link to Movies controller - #37588

Closed
manishm004 wants to merge 1 commit into
dotnet:mainfrom
manishm004:patch-2
Closed

Change navbar link to Movies controller#37588
manishm004 wants to merge 1 commit into
dotnet:mainfrom
manishm004:patch-2

Conversation

@manishm004

@manishm004 manishm004 commented Sep 4, 2026

Copy link
Copy Markdown

Text below the code snippet mentions the navbar link as Movies controller
Hence the change is necessary for the code to be in sync with the explanation just below it.


Internal previews

File Preview link
aspnetcore/tutorials/first-mvc-app/start-mvc/sample/MvcMovie90/Views/Shared/_Layout.cshtml Learn preview

Build report

For the code to be in sync with the further steps in the documentation
@wadepickett

wadepickett commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@manishm004, Thanks very much for offering to help here.

I think there is some confustion about the state the _Layout.cshtml has to represent at a particular point in the tutorial series. Over the course of steps it needs to represent one state and then later we have source that represents a later state after steps in the tutorial have been completed. The file you want to change in this PR represents an earlier state, not the completed state and needs to stay as is. (The PR should not change the file and the PR should be closed.)

The completed app example lives here in the sample/9.0-completed folder:
https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/tutorials/first-mvc-app/start-mvc/sample/9.0-completed

Here is a table to lay that all out where we can see it. This tutorial series contains a lot of progressive states as each new subject is taught.

Why the navbar brand link is HelloWorld in Part 3 (and shouldn't be changed to Movies):

The Get started with ASP.NET Core MVC series (aspnetcore/tutorials/first-mvc-app/) is deliberately built as a progression: you start with a temporary "example A" state and are later shown how to change it to "example B." The navbar brand link's asp-controller value is one of those things that intentionally starts as one value and changes later. Here's the full arc:

# Tutorial Doc file What's being taught Navbar brand asp-controller state (and why)
1 Get started start-mvc.md Create the MVC project from the template; run the default app. Default template value (Home) — no custom controller exists yet.
2 Add a controller adding-controller.md Create HelloWorldController; understand controllers/actions and routing (/HelloWorld). The only controller you've built is HelloWorld. This establishes "example A."
3 Add a view (this PR) adding-view.md Move from returning strings to Razor views; edit _Layout.cshtml; introduce ViewData to pass data from controller → view. HelloWorld — correct and intentional. The Movies controller doesn't exist yet; the tutorial explicitly notes the "Movie App" link "isn't functional" at this point. Pointing at HelloWorld matches the app you actually have.
4 Add a model adding-model.md Add the Movie model + EF Core; scaffold MoviesController and Views/Movies/*; move to strongly-typed models bound to database data. This is where it legitimately changes to Movies. Now that MoviesController exists, the "Movie App" link should route to /Movies — the "Test the app" step says "select the Movie App link" and shows the movie list. This is the "example A → example B" transition.
5 Work with SQL working-with-sql.md Seed/query data; work directly with the database. Movies (end state established in Part 4 continues).
6 Controller methods and views controller-methods-views.md Refine the scaffolded Movies controller actions and views. Movies.
7 Add search search.md Add query-string search/filtering to the movie list. Movies.
8 Add a new field new-field.md Add a model property and apply a migration. Movies.
9 Add validation validation.md Add DataAnnotations validation. Movies.
10 Details & Delete details.md Examine the generated Details/Delete methods. Movies — matches the *-completed samples (the final state).

The key point for this PR

  • The brand link's value is a navigation target, not a displayed value. The label "Movie App" is a hard-coded string the whole time — it never becomes data-driven. Only the destination controller changes: HelloWorld (Part 3) → Movies (Part 4).
  • So in Part 3, asp-controller="HelloWorld" is the correct, intentional temporary state. Changing it to Movies (as this PR suggests) skips ahead to a controller that doesn't exist yet and breaks the deliberate "start here, change it later" teaching device.

Two source-code collections (as expected in this series)

  • Per-step "state" samples (start-mvc/sample/MvcMovie10, MvcMovie90, MvcMovie80, …): capture each intermediate state. For Part 3, these should use HelloWorld.
  • Completed apps (start-mvc/sample/*-completed): the final state, which correctly uses Movies.

@wadepickett wadepickett self-assigned this Sep 4, 2026
@wadepickett wadepickett closed this Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants