Issue setting up groupdocs viewer in .Net MVC app

Hi,

I am trying to set up groupdocs viewer in my .NET MVC application. I am following this help tutorial - http://groupdocs.com/docs/display/viewernet/How+to+Use+GroupDocs.Viewer+for+.NET+MVC4

But I get the following console error - Cannot read property ‘prototype’ of undefined at $.fn.groupdocsViewer.prototype.applicationPath

What could I be doing wrong?


Hi Shweta,

Thanks for getting in touch. We’re sorry to see that you’ve issues using GroupDocs Viewer library in an ASP.NET MVC4 application.

The article - How to Use GroupDocs Viewer for .NET in an ASP.NET MVC4 Project is revised. Kindly download the sourcecode for the project described here.

I hope this of help. Please let me know if you have any additional questions and I’ll be glad to help.

Best Regards,
Vipin Thomas
GroupDocs Support.

Hi Vipin,

Thanks for you reply. I followed the same steps mentioned in the tutorial. Unfortunately, I still get the same error - Cannot read property ‘prototype’
of undefined at $.fn.groupdocsViewer.prototype.applicationPath

Our application uses Angular Js framework and Groupdocs uses Knockout JS. Do you think this issue could be due to any incompatibility between Groupdocs and Knockout?

Any help is greatly appreciated.

Thank you.

Hi Shweta,


Thanks for coming back to us with this additional detail.

Can you try the following please:

Please try to load the embedded versions of jQuery and jQuery UI:
@Html.CreateViewerScriptLoadBlock().LoadJquery().LoadJqueryUi()
instead of
@Html.CreateViewerScriptLoadBlock()

Hopefully this resolves the issue that you are seeing, if it does not can you please share with us a test project which demonstrates the issue so that we can investigate in more detail locally.

Please let us know how you get on?

Many thanks,

Derek

Derek Hyland, Venture Lead, GroupDocs (Aspose Pty Ltd)
Office: +1 (214) 329 9760

Hi Derek,

Thanks for your reply. I am already loading jquery and jquery in our application. So I have this currently - @Html.CreateViewerScriptLoadBlock().LoadJquery(false).LoadJqueryUi(false)

What I just noticed is that all script tags src like this -
http://myapplicationdomain/document-viewer/GetScript?name=GroupdocsViewer.all.min.js

return blank response. So it looks like that the path to document-viewer scripts is not getting set right or the scripts are missing.
Thank you!

Hi Derek,

I am using Angular JS framework in my app. Do you think this behavior is due to some inconsistency between Angular Js and Knockout JS?

Hi Shweta,


Thanks for the additional information, can you share a sample project on Dropbox which demonstrates the issue that you are seeing so that we can take a closer look, without checking a project locally we will not be able to help you to resolve the issue that you are seeing?

Many thanks,

Derek

Derek Hyland, Venture Lead, GroupDocs (Aspose Pty Ltd)
Office: +1 (214) 329 9760
Skype: derekh.aspose

Hi Derek,

We just created a barebone sample project for you to look at. You can download it here -

https://www.dropbox.com/s/t6zitzgnzi9x5t9/angular.groupdocs.example.zip

Please let me know if you have any questions. I really appreciate your help with this issue.

Thank you!
Shweta

Hi Derek,

Did your team get a chance to look at the sample project?

-Shweta

Hi Shweta,


Our dev support team have just started looking at this, I’ll come back to you in a few hours once they have had time to investigate.

Many thanks,

Derek

Derek Hyland, Venture Lead, GroupDocs (Aspose Pty Ltd)
Office: +1 (214) 329 9760
Skype: derekh.aspose

Hi Derek,

Any updates on this issue? I am sure your team ran into similar blocks as we did.

-Shweta

Hi Shweta,


We have reproduced the issue and our dev team are currently working to remove integration issues between Angular.JS and our .NET libraries.

It proved to be more complex that we thought so it could be Tuesday or Wednesday of next week before we release an Angular.JS compatible version.

Many thanks,

Derek

Derek Hyland, Venture Lead, GroupDocs (Aspose Pty Ltd)
Office: +1 (214) 329 9760
Skype: derekh.aspose

That’s great. Thank you for the update.

- Shweta

Hi Shweta,

Good news, we have updated GroupDocs Viewer for .NET and resolved the issues which stopped it working with Angular.JS, now your sample integration with Angular.JS works well. We updated your sample to generate Viewer’s frontend dynamically (please see changes in Index.cshtml). You can download an updated sample (updated Viewer for .NET DLL is included) here: https://www.dropbox.com/s/ruw00xol98vydwm/angular.groupdocs.example.zip

Please let me know if you have any other questions and we'll be glad to help?

Take care,
Sergey

Sergey Zhuravel
GroupDocs Developer Support

Hi Sergey,

The sample project looks good. Thank you so much for having this issue fixed.

Did your team have a formal release for this update? We are hoping to test integrate other libraries for comparison, annotation etc. Not sure if updated DLLs are available on your site already.

- Shweta

Hi Shweta,

We are glad to hear that everything is working well for you now.

About the new releases – we are working on new releases for all .net libraries at the moment, so if you check back tomorrow afternoon, new versions should be available for download.

Many thanks,

Sergey

Sergey Zhuravel

GroupDocs Developer Support

Hey all,


This is Chris from Bridgepoint. I work with Shweta. I uncovered a new challenge with GroupDocs in Angular. It turns out that if we use ng-include to pull in a partial view which has the GroupDocs viewer, the viewer does not render. Please see the link below for an example:

Dropbox - File Deleted - Simplify your life

Thanks for all your help!

Hi Chris,


We are sorry to hear that you have issues with our library in your project. We have passed your sample to our support developers to investigate the issue; maybe some updates in the sample or in the library will be required. We will notify you as soon as the issue will be fixed.


Many thanks,

Sergey

Sergey Zhuravel

GroupDocs Developer Support

Hello Chris,

Thanks for getting in touch,

We have some good news for you, we've managed to fix the sample you sent us and it's working well for us here. You can download fixed sample here - https://www.dropbox.com/s/xuuufbu0xnhempo/angular.groupdocs.example%20%282%29.zip

We made the following changes:

1. In the file groupdocsDiv.html - we added a new div element that will trigger the appropriate script from example.common.controller.js

2. In the file example.common.controller.js - we added some JS that will generate the GroupDocs JS function for rendering an instance of the GroupDocs Viewer for .NET

Please test our solution and let us know if this works well for your project.

If you have some more questions or if we can help you further, please feel free to get back in touch.