Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC 2 - How to ignore an entire directory using IgnoreRoute?

I've tried the following two methods to try and ignore my "Assets" folder, but I keep coming up with errors. Can anyone tell me exactly how the Ignore Regex is supposed to look?

    routes.IgnoreRoute("/Assets/")
    routes.IgnoreRoute("{*assets}", New With {.assets = "\/Assets\/(.*)"})
like image 218
Chase Florell Avatar asked Jul 15 '10 01:07

Chase Florell


1 Answers

Try

routes.RouteExistingFiles = false
routes.IgnoreRoute("Assets/{*pathInfo}")
like image 194
Mahesh Velaga Avatar answered Oct 12 '22 19:10

Mahesh Velaga