jQuery errors on viewer 2.19 (MVC project)

Hi all,


I am experiencing some problem in our C# MVC (over IIS 8.5) application using groupDocs viewer 2.19. Our code looks like this:

Golbal.asax:

Viewer.InitRoutes();
Viewer.SetLicensePath(Server.MapPath("~/Licenses/GroupDocs.Viewer.for.NET.lic"));
Viewer.SetRootStoragePath(Server.MapPath("~/SecureDataFiles/"));

View:

@using Groupdocs.Web.UI

@Html.CreateViewerScriptLoadBlock()


@(Html.ViewerClientCode()
.TargetElementSelector("#test")
.FilePath(“mass_media.doc”)
.Width(500)
.Height(300))

As you can see is a very simple test but I am getting the attached errors.

Regards,

Hi,


I’m sorry to hear that you have such issue. First of all I want to notify you that we have released a next generation Viewer library and if possible you should migrate on it.
As for the issue - try to use @Html.CreateViewerScriptLoadBlock().LoadJquery().LoadJqueryUi().UseHttpHandlers(false)
instead of @Html.CreateViewerScriptLoadBlock()

Best regards.

Hi Pavel,


Thanks for your quick response.

I can not update to 3.0 because my license does not include such version. I have to use 2.xx apparently.

I have tried what you suggested but the error persist (please check the attached image to see what we get).

This is the internal exception we get:

The controller for path ‘/document-viewer/GetScript’ was not found or does not implement IController.
The controller for path ‘/document-viewer/CSS/GetCss’ was not found or does not implement IController.

Kind regards,

Hi again,


Thank you for coming back. I have tried to reproduce your issue again but I can’t - all works well, you can compare your project with our example , also if this will not help you please share with me example of your project that I can check it on my side.

Thank you.

Hi Pavel,


Thanks for your quick response.

Thanks to your project I have managed to find what was wrong. In my Global.asax I had the Viewer calls after the ASP calls and you had it before. I have changed it so it looks like yours and now the viewer is rendering the document:

protected void Application_Start()
{
Viewer.InitRoutes();
Viewer.SetLicensePath(Server.MapPath("~/Licenses/GroupDocs.Viewer.for.NET.lic"));
Viewer.SetRootStoragePath(Server.MapPath("~/SecureDataFiles/"));
Viewer.EnableFileListRequestHandling(true);

AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}

Unfortunately this has not solved the issue 100%. Now the document renders but the header panel has no icons (groupDocsJqueryErrors_Header image) and I am getting similar errors than before (groupDocsJqueryErrors_Header_errors file)

Thank you very much for your help.

Regards,

Hi,


Glad to hear that my example was useful. To fix this issue you should add to your Web.config to system.webServer section this code:

or simply set the runAllManagedModulesForAllRequests parameter of “modules” to “true”:


Best regards.
Thank you very much Pavel, everything is working as expected now!

I hope you have a good day.

Kind regards,

Hi,


Glad to hear that.

Best regards.