我使用.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