Free Support Forum -

How to load document dynamically in annotation viewer using C# .NET?


We are trying to load document in Groupdocs.annotation viewer from javascript. But the document is not getting load.
How do we load document dynamically from js ?

viewer.groupdocsAnnotationViewer(“loadDocument”, filepath);

Vishnu Patel

Hi @Amr2015 We are sorry to hear that you have such issue. Could you please share with us which version of the GroupDocs.Annotation you use.

Thank you.

We are using

Vishnu Patel


We have GroupDocs.Annotation for different platforms, can you please mention the platform of
the API (.NET, Java or Cloud) you are evaluating? We will be looking forward to hear from you.

.NET MVC version


This feature is already implemented in our MVC showcase project. Please follow below steps to load documents dynamically:

  1. Put documents in App_Data directory of our project
  2. Run our project
  3. Select/Change file using icon on top left corner of the project

Furthermore our showcase projects are open-source, you can amend or enhance them to any extent.

Hi @sami.cheema,

I checked the showcase project, but i think you misunderstood my requirement. Instead of providing filename in File path like ".FilePath("Quick_Start_Guide_To_Using_GroupDocs.pdf")" , I want to load the file from javascript code as i need to load the annotation viewer for various files and i don’t want to reload the whole cshtml page.

Please provide me solution for the same instead of pointing to some demo projects where i cannot find the solution.


These are the only ways to load files. Firstly, the file name you set in FilePath is the name of the file you want to rendered by-default when project runs. Secondly, for loading files dynamically you just need to put your files in App_Data directory of the project, after running the project select/change file using icon on top left corner of the project named as Open File. This feature is implemented using javascripts in this project.

Please note that our showcase only demonstrate the two ways (discussed earlier) to load files. However, showcase project is open-source so, you can feel free to modify them as per your requirements.