Getting error - 'JSON' is undefined

Hi,


I have created asp.net web application in VS 2010. In this application, document is getting downloaded from SharePoint site and stored in temp folder. But, downloaded document is not viewable in GroupDocs viewer. Error message displayed is “JSON is undefined”. I have attached the screenshot of the same.

Also, I have attached Web.config and web pages in Files.rar file.

IIS - 7.5
Visual Studio - 2010
Browser - IE 9

If I run the application than I can able to view the document. But, accessing the hosted application shows the error ‘JSON’ is undefined.

Please help.

Thanks,
Bhaskar V

Hello Bhaskar,


We are sorry to hear that you have such issue. We have modified your code, please check find it attached.

Also make sure that you have set for the Viewer root storage the same path which you have in the:
string FolderPath = WebConfigurationManager.AppSettings[“FolderPath”].ToString();

Thank you.

Hi,
I have noticed one thing.
In URL, if localhost is used than viewer shows document without any issue. But, if system name used instead of localhost than viewer shows ‘JSON is undefined’ error.
Below mentioned are the URLs.
http://incrpvkmapp:63/Default.aspx?ItemID=35&ListID={BB555558-04EB-4D11-9FD8-E253E79A7628} - This URL shows error ‘JSON is undefined’
http://localhost:63/Default.aspx?ItemID=35&ListID={BB555558-04EB-4D11-9FD8-E253E79A7628} - This URL works fine without any issue.
Please let me know the changes required when system name is used instead of localhost in the URL.

Thanks,
Bhaskar V

Hello Bhaskar,


Thank you for this info. The reason of such issue with URL is in your IIS configuration. To resolve it you should check which URL is set for the web.site in the bindings . If you have “localhost” or as on the screenshot empty value you should change it to “incrpvkmapp”. Then restart your web site and delete all cache (temp folder) from the root storage of the documents for view (where you have store documents copied from the SharePoint).

Also for more information please investigate this documentation for how to configure bindings in the IIS.

Thank you.

Hi,


Your suggestion worked.

Thanks,
Bhaskar V

Hello,


Glad to hear that.

Thank you.