How to fix the 404 Not Found error during the request to Active Query Builder handlers?

We have identified two possible reasons for the 404 error during the request to AQB handlers:

1. In some configurations, for unknown reasons, the automatically added route is removed due to other customizations. This can be fixed by adding the BaseHandler.Register() method at the end of your route configuration routine.

2. Running an MVC or WebForms project in a Virtual Directory with IIS.

The component automatically registers the route to the System.Web.Routing.RouteTable with the following template:

ActiveQueryBuilder/Handler/{action}/{*params}

You can fix this issue by explicitly indicating the virtual directory on which the route will reside.

Rendering the component server-side (MVC, WebForms) you can define the virtual directory in the Application_Start method using the BaseHandler.VirtualDirectory property.

In the case of client-side JavaScript rendering, set it by the AQB.Web.virtualDirectory JavaScript property.

Alternatively, you can define a rewrite rule to forward calls to the Active Query Builder handlers inside the virtual directory using the URL Rewrite module for IIS for that.

You can add it via the IIS manager UI or manually add the following directives to the 'web.config' file: