Questions tagged [ignoreroute]

20 questions
23
votes
4 answers

How to ignore route in asp.net forms url routing

I am using the .NET 3.5 SP1 framework and I've implemented URL routing in my application. I was getting javascript errors: Error: ASP.NET Ajax client-side framework failed to load. Resource interpreted as script but transferred with MIME type…
Austin
  • 4,638
  • 7
  • 41
  • 60
18
votes
1 answer

Difference between RouteCollection.Ignore and RouteCollection.IgnoreRoute?

What's the difference between RouteCollection.Ignore(url, constraints) and RouteCollection.IgnoreRoute(url, constraints)? Background New MVC projects include this IgnoreRoute call in Global.asax RegisterRoutes method to skip routing for requests to…
patridge
  • 26,385
  • 18
  • 89
  • 135
14
votes
4 answers

How do I block requests for all *.php, *.cgi, etc. pages from inside an ASP.NET MVC 1.0 app hosted in IIS7?

I'd like to block requests to any .php or .cgi regardless of the pathing information. For example, when the following url is used: http://mysite/Admin/Scripts/Setup.php It matches an existing route: routeCollection.MapRoute("Admin",…
Doug Wilson
  • 4,185
  • 3
  • 30
  • 35
7
votes
2 answers

What is the difference between these two ASP.NET MVC IgnoreRoute directives?

The default ASP.NET MVC 3 project template contains the following IgnoreRoute directive: routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); I have now seen multiple projects change this line (including StackExchange's DataExplorer) to instead…
ckittel
  • 6,478
  • 3
  • 41
  • 71
5
votes
4 answers

IgnoreRoute in ASP.MVC

I am trying to access a .js file in the views directory. I have an MVC application with /Views/Home/MyControl.ascx I have a js file /Views/Home/MyControl.js I wish to reference the .js file and keep it with the control. I have tried the following…
Craig
  • 83
  • 1
  • 6
4
votes
0 answers

IgnoreRoute not working for PIE.htc

I've been search for a long time and just can't seem to find my mistake. For my MVC 3 website, I need buttons with rounded edges, so in the IE stylesheet I register the PIE.htc. Now the problem is that when a button is clicked, the PIE.htc is…
Nischo
  • 454
  • 6
  • 20
2
votes
2 answers

IgnoreRoute for PHP Site embedded in ASP.NET MVC 3

I have an MVC 3 site with an embedded worpress blog. All the following urls are directed through MVC. www.mysite.com www.mysite.com/aboutus www.mysite.com/contactus I also have a top level directory called Blog, which is a php wordpress blog. If…
Steve
  • 21
  • 2
1
vote
2 answers

ASP.NET MVC IgnoreRoute method doesn't work correctly when URL starts with "/Views/"

I use ASP.NET MVC in my application. Users can specify their own images, styles, scripts by including them on the page. But when they specify URL to the file which not exists then routing mechanism tries to find controller and action by URL to image…
Anton Palyok
  • 1,249
  • 1
  • 16
  • 27
1
vote
0 answers

IgnoreRoute doesn't seem to work in my mixed MVC and ASP.NET application

I am routing existing aspx files to a mvc controller to test things out, I wanted to also have a way to ignore the routing using IgnoreRoute, then I can just comment in or out that one line to switch between the aspx and MVC versions. e.g.…
user2000095-tim
  • 446
  • 2
  • 6
0
votes
1 answer

Can I create a route that matches an already ignored route?

So, I have the following in my global.asax creating my MVC routes. They are called in the order that they appear below. What I expected to have happen was it would ignore the routes to the css folder, but then create the route to css/branding.css…
Anthony Shaw
  • 8,146
  • 4
  • 44
  • 62
0
votes
0 answers

IgnoreRoute with file extension is not working in MVC

I have a Content folder and i want all the html files inside the Content folder from getting accessed, so i added this line at the top of the RegisterRoutes() method in the RouteConfig.cs file as follows …
Lijin Durairaj
  • 4,910
  • 15
  • 52
  • 85
0
votes
2 answers

ASP.NET routing ignoreRoute does not work

I can't exclude non-existing files from the routing system. I am dealing with this code in a Web Forms scenario: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); …
Joseph Bi
  • 1,166
  • 2
  • 9
  • 11
0
votes
1 answer

How to get ASP.NET MVC IAuthorizationFilter to respect IgnoreRoute's

I am using the popular Elmah.MVC error logging NuGet package. So I can navigate to /elmah to view my error logs. I have the following IgnoreRoute statements, so that MVC ignores the /elmah…
Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311
0
votes
1 answer

where is IgnoreRoute for *.config files?

there is no IgnoreRoute for *.config files but I can't request for web.config or other files that has .config extension. where exactly this restriction defined?
0
votes
1 answer

Could someone explain how this ignore route works?

So I added an ASMX web service to my MVC4 but when I tried to access it I got a "The Resource could not be found" error. After searching I found the answer here. In short, I had to add the following IgnoreRoute to my RouteConfig…
Grim Coder
  • 394
  • 2
  • 12
1
2