문제

I had a working project in VS2008 / .Net 3.5 using controls from the ajax control toolkit (which targets .Net 3.5).

I upgraded the project in VS2010 Beta 2. I chose to target .Net 4.0 so I could take advantage of routing for WebForms (which is working).

When a page with a ModalPopupExtender loads, however, I get errors, "Syntax error" referencing a URI like:
{localhost}/WebResource.axd?d=-sR5kj2yKK777ENh8pDLSA2&t=633960551687981257.
Then the page loads incorrectly because the necessary javascript files failed to load.

I tried downloading the new control toolkit from ajax.codeplex.com and referencing the AjaxControlToolkit.dll within, clearing out temporary files for framework 2.0 & 4.0, but it made no difference.

I then read this post about further debugging the error. When I decrypted the requests to WebResource.axd, they showed paths that looked like yay:

  • s|WebForms.js
  • ZSystem.Web,4.0.0.0,,b03f5f7f11d50a3a|WebUIValidation.js|

So pipe delimited references to files seem to have been constructed incorrectly. It seems unlikely anyone would have any idea what to do about this, but what the heck...

도움이 되었습니까?

해결책

add
RouteTable.Routes.Ignore( "*.js" );
to RegisterRoutes in Global.ascx.cs

다른 팁

You can download the source from codeplex and rebuild it for .NET 4.0 via VS 2010 but i don't think it will do much help.

If you want to use Routing which is part of .NET 3.5 (with SP1) what you have to do is to exlude *.axd handlers from being routed.

Here is a sample C# code to achieve that

RouteTable.Routes.Add(new Route("{resource}.axd/{*pathInfo}", new StopRoutingHandler()));

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top