Uncaught TypeError: Cannot read property 'docViewer' of undefined
Problem reported by Delwyn Pinto - 9/30/2020 at 1:44 AM
Submitted
My project is on Vb.Net with Framework version 4.
I have added Document Ultimate is a User Control following the steps mentioned here :
https://docs.gleamtech.com/documentultimate/html/adding-references-to-documentultimate-assemblies.htm
https://docs.gleamtech.com/documentultimate/html/using-documentultimate-in-an-asp-net-webforms-project.htm

While the UI is loading, the document does not open and throws the error messages in the image attached.



Code is as follows :

<%@ Register TagPrefix="GleamTech" Namespace="GleamTech.DocumentUltimate" Assembly="GleamTech.DocumentUltimate" %>
<%@ Register TagPrefix="GleamTech" Namespace="GleamTech.DocumentUltimate.AspNet.WebForms" Assembly="GleamTech.DocumentUltimate" %>

<script type="text/javascript" src="<%=siteURL%>Javascript/swfobject.js"></script>

<div id="<%=popUpFlashWrapperID%>">

<GleamTech:DocumentViewerControl ID="documentViewer" runat="server"
Width="800"
Height="600"
Document="<absolute path to .doc file>" />
</div>



Have I missed anything ? 

4 Replies

Reply to Thread
0
Cem Alacayir Replied
Employee Post
As you can see from the error message, this is a cross domain issue:


More information on this issue:

Chrome starting with version 76 treats cookies as SameSite=Lax by default if no SameSite attribute is specified.

And ASP.NET without below these updates (it's about the version on your deployment server, not VS development environment), does not emit the SameSite cookie header for the None value (SameSite=None):
For .NET Framework 4.6 to 4.7.2, install KB 4524421
For .NET Framework 4.8, install KB 4531182

  • Before the patch a value of Nonemeant:
    • Do not emit the attribute at all.
  • After the patch:
    • A value of None means "Emit the attribute with a value of None".
    • The default SameSite value for forms authentication and session state cookies was changed from None to Lax.
After these updates, you can use this setting in Web.config and SameSite=None cookie header will be sent:

<system.web>
        <httpCookies sameSite="None" />
        <sessionState cookieSameSite="None" /> 
</system.web>    
For more details:

0
Delwyn Pinto Replied

Hi,

The exact same code worked in a fresh blank project, with the exact same tech stack. Which leads me to believe the cause of this error is something else entirely.

Also, our project is a legacy project. Upgrading the .NET framework from version 4.0 to 4.8 will be tedious which we would like to avoid.

Is there any other way to get around this error ?

0
Delwyn Pinto Replied
Hi. Still waiting for a response. We have client deliverables that are pending on this.
Could it be possible to look into this on priority ?
0
Delwyn Pinto Replied
Hi, we have purchased an Enterprise License for Document Ultimate but still facing these errors.
Any ideas on how to resolve this ?

Reply to Thread