This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Routing for View Pages #5353
Comments
cc @DamianEdwards \ @rynowak |
pranavkm
added a commit
that referenced
this issue
Nov 17, 2016
pranavkm
added a commit
that referenced
this issue
Nov 18, 2016
pranavkm
added a commit
that referenced
this issue
Nov 21, 2016
@pranavkm The MapPageRoute method doesn't exist on RazorPageOptions in Preview 1.0. Has this configuration option been moved somewhere else? Not included at all? If not, are there still plans to include it? |
@mikebrind - doesn't look like I did any of the work for making friendly urls work - must've missed it. @rynowak - are we still on for adding a convention extension to register additional routes? |
Also cc @DamianEdwards |
Oops. This is meant to be there. Can we create a new issue to track this work and triage it into the next milestone please? We're out of time to do it in this one. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Routing
By default, the route for each page is mapped at it's application relative path (with the cshtml extension). The file name
Index
is optional and has the same behavior as routing to an action namedIndex
in conventional routing i.e./Home/Index and /Home are equivalent. The optional value of the
@page
directive can be used to append a suffix to this route. Consider,@page
@page "location/{zip}"
@page
@page "{id?}"
Friendly urls
Associated with each page is an application model type similar to
ControllerModel
. We'd build on top of this to provide simple runtime configuration of routes. For instance, to configure an additional route to the/Catalog/Books.cshtml
, here's what the Startup code might look like:The text was updated successfully, but these errors were encountered: