Search code examples
htmlasp.netasp.net-mvcasp.net-corenavigationbar

Navigation bar disappears after navigating - HTML


I'm currently developing an asp.net core web app, and I'm struggling on correctly navigating through the app.

Here is my directory structure, note that I'm using Areas.

1st part 2nd part

Now, the exact problem is that I'm able to navigate through the pages that are in the main folder like Index, Index1 and Private, but once I go to the Area, I am no longer able tonavigate correctly.

It is remarkable to say that the Layout code of the _Layout and _LaunchLayout is almost the same, only changes the name of the navigation items and their destinations.

Once I click any item on the navigation bar to navigate, the corresponding page shows up but the navigation bar disappears.

I'd appreciate some help on this, thanks to you all beforehand.


EDIT: Link to the project

https://github.com/Rogeraj2001/GraphicProofOfConcept.git


Solution

  • Well, after trying some things I found a workaround. That has been to specify the view route in the controller action:

    public IActionResult _ViewStart() {
        return View("~/Areas/LaunchArea/Views/_ViewStart.cshtml");
    }