Custom Routes with Stimulsoft MVC Viewer
Posted: Mon Apr 08, 2013 8:40 pm
We created a custom routes for our application, the custom route includes culture, but isn't limited to culture. The route config looks like this:
So the URLs looks like
generates, from that line, we can see that the routes are ok, the problem is the requestUrl.
And the StiMvcViewerOptions are:
Is there anyway to configure our custom routes for the MvcViewer?
Code: Select all
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapActionRoute("Default", "{culture}/{controller}/{action}/{id}",
new { controller = "Home", action = "Login", culture = "en", id = UrlParameter.Optional },
new CultureConstraint(Culture.en.ToString(), Culture.fr.ToString(), Culture.ru.ToString())
);
}
and for my report the URL looks:
The problem is that the report viewer is calling a URL via ajax that isn't formed correctly. the /en/ (culture part) isn't included in the Ajax call. It's calling:
To give you more info, the
Code: Select all
@Html.Stimulsoft().StiMvcViewer(@Model.StiMvcViewerOptions
Code: Select all
"requestUrl":"https://localhost:44300/Certificat/","actionInteraction":"Interaction","routes":"%7b%22culture%22%3a%22en%22%2c%22action%22%3a%22CertificatMiseEnReserveReport%22%2c%22controller%22%3a%22Certificat%22%2c%22id%22%3a%221%22%7d"
Code: Select all
StiMvcViewerOptions = new StiMvcViewerOptions()
{
Theme = StiTheme.Office2010,
ActionGetReportSnapshot = "GetReportSnapshot",
ActionViewerEvent = "ViewerEvent",
ActionPrintReport = "PrintReport",
ActionExportReport = "ExportReport",
ActionInteraction = "Interaction"
};