Tuesday, April 12, 2011

RadBinaryImage MapPageRoute not working

Under ASP.NET 4.0, when using System.Web.Routing (URL Routing) with telerik controls I received broken images.

void RegisterRoutes(System.Web.Routing.RouteCollection routes)
//make sure this is first
routes.Add(new System.Web.Routing.Route("{resource}.axd/{*pathInfo}", new System.Web.Routing.StopRoutingHandler()));

//...other routes here

found the answer here:

Deploying ASP.NET 4 Web Forms Application Using Routing on IIS 6

In IIS 6, opened the properties dialog of the virtual directory, went to the "Directory" tab, click the "Configuration" button, and added a Wildcard application map to the aspnet_isapi.dll (c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll) and unchecked the "Verify that file exists" checkbox. This made it work.