Showing posts with label MVC Routing. Show all posts
Showing posts with label MVC Routing. Show all posts

BASICS OF ROUTING IN MVC


In simple words: Routing is process of mapping incoming request url to a resource, which can serve the request. 
Why do we need  routes? Aren’t our web application and web servers not capable of matching user request to specific resource/web page (.html or aspx or php) on the server? The answer is “Yes”. However, let say user requests a page or URL that doesn’t exist on server at all. What do we do in that case? Showing 404 page always is not good idea. This is where routing comes to rescue. Using routing you can define routes that need not always map against physical file on the server