8.2: URL and Routes Discussion
In this section, we'll learn about RouteConfig.cs
and how our URLs are made up.
RouteConfig.cs
RouteConfig.cs
Go to ElevenNote.Web -> App_Start -> RouteConfig.cs.
Have a look at
routes.MapRoute()
url:
is what builds out the Url we see on the webpage.{controller}
is the particular controller we are using. For this project, chances are it will be Note.{action}
is the ActionResult we are calling on (Create, Details, Edit, or Delete).{id}
is an optional parameter that will only be used when we are working with a specific note. We'll add theNoteId
to the end of the Url in these cases.
The default parameter is currently set to open the application on the Home page.
Next, we'll work on NoteEdit
Last updated