Skip to content

ghstahl/AspNet-Core2-Page-Route-Problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

AspNet-Core2-Page-Route-Problem

Problem: adding the following;

@page "{id?}"

to the top of a page causes it to pick up the route of other pages.

Produce:

  1. Out-of-the-box asp.net core2.1 WebApplication
  2. Add the following to contacts.cshtml and about.cshtml
@page "{id?}"
  1. Route to;
https://localhost:44306/About/hello
  1. Now click on "Contacts" in the NavBar.

You will be routed to

https://localhost:44306/Contact/hello

HWhattt?

I have tried replacing;

  app.UseMve();

with

 app.UseMvcWithDefaultRoute();

Still the same problem.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published