URL Routing
Why we have to set our own link in browser?
Let's take a look at http://makersinstitute.id
- http: is the protocol
- makersinstitute.id is the host name
- Host name is the domain name of the website
However, when running website locally, like we did, a special name, i.e. localhost, is used. The number is port which assigned differently for each project in Visual Studio. So, we could run multiple projects in visual studio.
Path pattern is controller/action
. ComicBooks/Details means ComicBooks is the name of controller and Detail is the name of Action.
Process of matching a URL to controller action is called URL Routing.
Now, we don't want to return string, right? We want to return the content. Change a little bit of our code to be like this.
public ActionResult Detail()
{
return Content("Hello from ComicBookController");
}