我使用.NET 3.5 SP1框架,并且在我的应用程序中实现了URL路由。我得到的JavaScript错误:如何忽略asp.net表单中的路由url routing
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
我相信这是因为我的路由拿起微软AXD文件,无法正常发送下来的JavaScript。我做了一些研究,发现我可以用Routes.IgnoreRoute
,这应该让我忽略AXD象下面这样:
Routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
但是,当我再补充一点线到我的Global.asax中我得到这个错误:
CS1061: 'System.Web.Routing.RouteCollection' does not contain a definition for 'IgnoreRoute' and no extension method 'IgnoreRoute' accepting a first argument of type 'System.Web.Routing.RouteCollection' could be found (are you missing a using directive or an assembly reference?)
我有System.Web.Routing
命名空间导入,任何想法?
谢谢,这是一个巨大的帮助。 – Austin 2008-11-10 14:20:09
如何忽略ASP.NET Core(MVC 6)中的* .php文件?它有很大的不同! – jp2code 2016-06-21 13:27:59