user49126
user49126

Reputation: 1863

ASP.NET MVC - Ignore specific route

I need to ignore routes matching this schema

/{controller}/edit/undefined

{controller} - could be any controller

BTW I was wondering when to use Ignore and when IgnoreRoute.

Upvotes: 1

Views: 800

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038830

You could add the following at the beginning of your route definitions:

routes.IgnoreRoute("{controller}/edit/undefined");

BTW I was wondering when to use Ignore and when IgnoreRoute.

It's the same thing. IgnoreRoute is an extension method that does the same as Ignore.

Upvotes: 2

Related Questions