We have an MVC single-page application where the map is located on the page defined by the default routing (Home/Index). The *.axd resource files load fine when the "full" URL containing the controller and action is used (e.g., /localhost/applicationname/home/index), but when just the application root URL (/localhost/applicationname) is called, MVC correctly re-routes the request to HomeController.Index to load the page, but the resource files point to /localhost/, not /localhost/applicationname. This causes 404 - Not Found results for the axd resources.
We can correct the behavior for the core js libraries by setting MapBuilder.IsDefaultJavascriptLibraryDisabled to true in the partial view containing the mapusing and using hard-coded script references in the page, such as:
<
script
type
=
"text/javascript"
id
=
"opl"
src
=
"@Url.Content("
~/opl_GeoResource.axd")">
script
>
However, other calls to axd files during map loading still have the incorrect URL. For example, tiles are loaded using:
localhost/tile_GeoResource.axd (URL is missing application name, which cases 404 - Not Found result)
How can we configure the map to use the correct URLs in this situation? In other words load the map using
localhost/applicationname
and have all resources use relative URLs like:
localhost/applicationname/<somemapresource>.axd
Thanks
</somemapresource>