Hello
I am testing GroupDocs.Annotation as a possible solution for our company. I started setting up an empty .aspx website that runs on my local computer with iis7. I am now getting an javascript error with the following error message:
Unhandled exception at line 6, column 99443 in localhost
0x800a138f - JavaScript runtime error: Unable to get property ‘code’ of undefined or null reference
I can send a screen-shot and a zip-file with the solution.
I hope you can point me in the right direction.
Greetings
Robert Badi
Hello Ihor
The File attachment button does not work on your website to I am resorting to box.com. Here is the screenshot: box.com
And here is the solution zipped: box.com
Greetings
Robert Badi
Hello Robert,
We downloaded and reviewed your project. Here is a list what we had found:
1. web.config
1.2. You need to specify in the system.webServer section in order to display elements of toolbar properly.
2. Index.aspx
2.2. ToHtmlString() is useless because this method is invoked automatically while rendering a page.
2.3. DIV “annotation-widget” has incorrect style = “width: 100%; height: 100%;”. You cannot simple set a DIV height to 100%. So when you use height: 100% it does not matter what is inside this DIV - it wouldn’t be 100% height, only width. You can find more info here: Make div 100% height of browser window In order to make viewport 100% tall you need to set “height: 100%” for all parent elements. Another and much easier way - to set height in absolute points, pixels, for example:
If you will have more questions please feel free to contact us.
Dear Denis
Hello Robert,
We downloaded and reviewed your updated project. Especially we want to thank you for detailed video screencast.
But first we will answer to your questions from previous post.
1. “If I add the handlers for classic mode also into web.config I get a server error.” - yes, this is default behavior. By default IIS raises an error when web.config is configured for both Classic and Integrated modes. But this can be fixed by using statement in the “system.webServer” node.
2. “ToHtmlString” in ASPX page (code-front) it is simply useless. It makes sense when you place a server control on the code-behind.
And now about your error. We could not reproduce the exact error that you have experienced. But the situation when left toolbar panel is absent is very common. It usually occurs when there is a discrepancy (mismatch) between data stored in the database and data stored in the “file-sessions.json” file in the “App_Data” folder.
In the “file-sessions.json” that is present in your project there is a line
“Quick_Start_Guide_To_Using_GroupDocs.pdf”: 2
In the code-behind (Index.aspx.cs) there is a adding collaborator "testuser@groupdocs.com" procedure. It seems that due to data mismatch the user "testuser@groupdocs.com" has no permission to add annotation to the document so that’s why toolbar is absent.
In order to fix it open your database (you are using SQL Server). In the “Users” table you should find "testuser@groupdocs.com" - note his “Id”. Then go to the “Annotation” table. If it is not empty, for proper functioning there should be annotation record, where “AnnotationSession” should be “2” (from your “file-sessions.json”). “UserID” should be the same as "testuser@groupdocs.com" has.
If “Annotation” table is empty or this guide will not help, simply remove all records from all tables within “GroupdocsAnnotation” database and also remove “file-sessions.json” file. Also remove all cache (“temp” folder in the “App_Data”). Then restart web-site. GroupDocs.Annotation will recreate file and begins to work “from scratch”.
Another little remark. In your web.config remove “GetPdf2XmlHandler” HTTP-handler (it is obsolete and doesn’t exist in GroupDocs.Annotation 1.3.0.0) and add HTTP-handler
Hope this will help. If you will have more questions please feel free to contact us.
Hello Denis
Hello Robert,
Hmmm, your error is pretty strange. Can you please make the following:
1. Do you see a popup message “There is no such reviewer” when page (“Index.aspx”) loading is completed?
2. Can you check a request/response scanner while page is loading? You can use for example Firebug, or “Net” tab in Google Chrome, or Fiddler2, for example. If all is fine then all requests/responses should be successful. Please take a look at all SignalR-related requests like:
/signalr1_1_2/hubs
localhost
/signalr1_1_2/hubs/connect?transport=
/signalr1_1_2/hubs/send?transport=
Are all of them have HTTP 200 OK response? If all is fine you should get something like that: Screenshot by Lightshot
Hello again Denis
URL | Protocol | Method | Result | Type | Received | Taken | Initiator | Wait | Start | Request | Response | Cache |
---|
Hello Robert,
Now the situation is much more clear. I can suggest that in the IIS you are using Virtual Catalog system for hosting this web-site, in opposite to the separate web-site. I think the error is because GroupDocs.Annotation forms the URL improperly. Take a look at full absolute URL that has 404 response - its domain name should differ from all other “200 OK” requests.
If this is true, just add to the HEAD section of your web-page a correct inclusion like this:
Please try this and come back to us with results.
Hello Denis
Hello again Robert,
SignalR is responsible for “annotation tools” left panel and that’s why it is not working for you - something blocks SignalR-related requests/responses. You stated at previous posts that you are using IIS. Maybe this is a reason. Now we need to narrow a set of all possible reasons that can lead to this error. So please try to launch your web-site not using IIS, but at this time use IIS Express or ASP.NET Development Server. It can be easily done if you use MS Visual Studio - go to the Properties - Web tab - Servers - > Use IIS Express. But, of course, don’t forget to remove the line that I suggested to you at previous post
because at this time domain name will be another.
Using that it will be able to define whether IIS is a reason of the error or not.
Hi Denis,
I also got almost the same issue when I tried to run the demo using MVC5, right now, when I starts my project in IIS Express, I will get an error of “there is no such viewer” and no annotation toolbar. If I starts my project on my local IIS server, I’ll get the exact same javascript error. So could you give me a runnable demo of ASP.NET MVC5, maybe this could help me identify the mistake I made. Thanks!
Hello Brian,
1. There is a package “GroupDocs.Annotation C# Demos” at our web-site. This is a demo solution which contains several projects, including WebForms and MVC. All these demos use SQL Server Compact as a storage, but it is very easy to switch this to the SQL Server.
2. GroupDocs.Annotation is compatible with all types of web-servers including IIS 6+, IIS Express and ASP.NET Development Server (Cassini). But when using IIS you need to perform additional actions like files/folders access etc. Also there are several specific problems like we discussed in previous posts. So my intention was to launch Robert’s project under IIS Express or Cassini in order to define a reason of error - is it Annotation-specific or IIS-specific.
3. “Uh-oh. There is no such reviewer” is not the same error as the previous that was described. When you see this message then SignalR is working; in opposite you will be not able to see this message. In fact this is not an error; this message says that current user is not registered as a reviewer. In order to fix this please clean your database and also remove “file-sessions.json” file. Also clean the browser cache and restart the web-site.
Hope this will help. If you will have more questions please feel free to contact us.
Hi Denis,
Thanks for your help, I’ve already fixed my problem, it’s caused by the wrong test account I used in my controller.
PS: I’m not Robert, I just had the same problem with Robert so I followed this case.
Hello Robert,
We are sorry to hear that you have such issue.
Thank you for such detailed screencast. We assume that you are using the same test project that you have pointed here: http://groupdocs.com Multiple result mark OMR Grid .NET - Free Support Forum - aspose.com (https://app.box.com/s/pm32jmksqdgbfl0y3ko9
). We cannot reproduce now the exact error but we observe very similar client-side JS-related error. It occures only in Internet Explorer, in other browsers web-site works fine.
Here is a solution how to make it work in Internet Explorer:
1. Download the latest GroupDocs.Annotation for .NET version 1.4 from groupdocs.com and replace old 1.3 library onto this new 1.4.
2. Add a <meta http-equiv="X-UA-Compatible"content=“IE=edge” /> line to the section of a “Index.aspx” page.
If you will have more questions please feel free to contact us.
Hello Denis
Hello Robert,
We are sorry to hear that you have such issue. We have downloaded and reviewed your project.
In this current case the error is because you need to use default user “groupdocs@groupdocs.com”. Your database is empty, there are no users, so in order to allow anonymous users or guests make annotations you need to refer to the hardcoded “groupdocs@groupdocs.com”. So in the code-behind of the “Index.aspx” page please change
svc.AddCollaborator(_filePath, “testuser@groupdocs.com”, “FirstName”, “LastName”, null);
to the
svc.AddCollaborator(_filePath, “groupdocs@groupdocs.com”, “FirstName”, “LastName”, null);
Of course, database and “file-sessions.json” file should be empty.
If you will have more questions please feel free to contact us.