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 text/html.
ReferenceError: Can't find variable: Sys
Which I believe is because my routing is...
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", "admin/{controller}/{action}/{uid}/{*pathInfo}", new { controller = "Admin", action = "Index", u...
Hi,
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 entries in the routing, and none seem to work.
routes.IgnoreRoute("{resource}...
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}");
routes.IgnoreRoute("{resource}.gif/{*pathInfo}");
routes.IgnoreRoute("{resource}.jpg/{*pathInfo}");
R...
I've seen numerous blog posts that indicate that, to use ASP.NET Webforms within an MVC application,simply add a line like
routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
to the RegisterRoutes routine, and the aspx files will be ignored and served up in the conventional manner by IIS.
However, it's not working. We are...