R
R
Roman Rakzin2016-10-24 01:37:51
ASP.NET
Roman Rakzin, 2016-10-24 01:37:51

How to configure that any route would lead to one controller and action on ASP:NET MVC?

How can I make all requests go to one controller and action (except for static and api, which I will specify)? Since my routing actually does JavaScript on the client, I want to display the same View for any request

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2016-10-24
@petermzg

Will it fit?

routes.MapRoute("NotFound", "{*url}", new { controller = "Error", action = "404" });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question