i asked a question here throw 404 error when route is not satisfied and getting the answer, i thought: is the design i choosed a good one, so i decided to post it as a separate question:
what do you think is a better solution: hardcode 100 routes for every page in my webapplication and one catch all route to redirect to the 404 page, or hardcode 1 ‘generic’ route and catch all ‘wrong’ url’s in the error handler?
The ‘problem’ with the latter is that when the app is flooded with bad urls, the app will throw (expensive as i always read) loads of exceptions….
Having too many routes is also inefficient, specially for URL generation. You can:
HandleUnknownAction, so it doesn’t throw an exception.controllerandactiontokens. A tool like MvcCodeRouting can help you automate this.