"Unable to get value of the property 'appendChild': object is null or undefined" while opening page in new window
<p>I get the following javascript exception while I opening web page in new window</p>

<blockquote>
  <p>Unable to get value of the property 'appendChild': object is null or undefined.</p>
</blockquote>

<p>I use window.open function to open my page in new window, although this exception appear only in IE browser.</p>

<p>the following is my web page</p>

<pre><code>&lt;%@ Page Title="" Language="C#" AutoEventWireup="true" 
MasterPageFile="~/Page.Master" 
CodeBehind="DocumentForm.aspx.cs" Inherits="Docunet.WebViewer.DocumentForm" %&gt;

&lt;%@ Register Assembly="Atalasoft.dotImage.WebControls" Namespace="Atalasoft.Imaging.WebControls"
    TagPrefix="cc1" %&gt;

&lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %&gt;

&lt;asp:Content ID="head" ContentPlaceHolderID="headContentPlaceHolder" runat="server"&gt;

    &lt;link href='&lt;%# "Styles/DocumentFormStyles" + this.GetGlobalResourceObject("Layout", "Culture").ToString() + ".css"  %&gt;' rel="stylesheet" type="text/css" /&gt;

&lt;/asp:Content&gt;

&lt;asp:Content ID="content" ContentPlaceHolderID="contentContentPlaceHolder" runat="server"&gt;

    &lt;div id="mainTitleBox" class="MainTitleBox"&gt;
        &lt;asp:Label ID="mainTitleLabel" runat="server" 
            class="MainTitle"  
            meta:resourceKey="mainTitleLabel" Text=""&gt;&lt;/asp:Label&gt;
    &lt;/div&gt;
    &lt;asp:UpdatePanel ID="updatePanel" runat="server"&gt;
        &lt;ContentTemplate&gt;
            &lt;div id="viewBox" class="ViewBox"&gt;
                &lt;div class="instanceDataBox"&gt;
                    &lt;asp:TabContainer ID="tabContainer" runat="server" ActiveTabIndex="0" &gt;
                        &lt;asp:TabPanel ID="generalTabPanel" runat="server"  
                            CssClass="Text"
                            meta:resourceKey="generalTabPanel" HeaderText="" &gt;
                            &lt;ContentTemplate&gt; 
                                &lt;div class="Text"&gt;
                                    &lt;p class='&lt;%# this.ReadRecordMode ? "DataParagraph" : "EditModeDataParagraph" %&gt;'&gt;
                                        &lt;asp:Label ID="numberTitleLabel" runat="server" 
                                            CssClass="titleControl" 
                                            meta:resourceKey="numberTitleLabel" Text="&lt;%# this.NumberFieldName %&gt;" &gt;&lt;/asp:Label&gt;
                                        &lt;asp:Label ID="numberLabel" runat="server" 
                                            CssClass="valueControl" 
                                            Visible="&lt;%# this.ReadRecordMode %&gt;"&gt;&lt;/asp:Label&gt;
                                        &lt;br /&gt;
                                    &lt;/p&gt;
                                    &lt;p class='&lt;%# this.ReadRecordMode ? "DataParagraph" : "EditModeDataParagraph" %&gt;'&gt;
                                        &lt;asp:Label ID="yearTitleLabel" runat="server" 
                                            CssClass="titleControl" 
                                            meta:resourceKey="yearTitleLabel" Text="&lt;%# this.YearFieldName %&gt;" &gt;&lt;/asp:Label&gt;
                                        &lt;asp:Label ID="yearLabel" runat="server" 
                                            CssClass="valueControl" 
                                            Visible="&lt;%# this.ReadRecordMode %&gt;"&gt;&lt;/asp:Label&gt;
                                        &lt;br /&gt;
                                    &lt;/p&gt;
                                    &lt;p class='&lt;%# this.ReadRecordMode ? "DataParagraph" : "EditModeDataParagraph" %&gt;'&gt;
                                        &lt;asp:Label ID="codeTitleLabel" runat="server" 
                                            CssClass="titleControl" 
                                            meta:resourceKey="codeTitleLabel" Text="&lt;%# this.CodeFieldName %&gt;" &gt;&lt;/asp:Label&gt;
                                        &lt;asp:Label ID="codeLabel" runat="server" 
                                            CssClass="valueControl" 
                                            Visible="&lt;%# this.ReadRecordMode %&gt;"&gt;&lt;/asp:Label&gt;
                                        &lt;br /&gt;
                                    &lt;/p&gt;
                                    &lt;p class='&lt;%# this.ReadRecordMode ? "DataParagraph" : "EditModeDataParagraph" %&gt;'&gt;
                                        &lt;asp:Label ID="categoryTitleLabel" runat="server" 
                                            CssClass="titleControl" 
                                            meta:resourceKey="categoryTitleLabel" Text="&lt;%# this.CategoryFieldName %&gt;" &gt;&lt;/asp:Label&gt;
                                        &lt;asp:Label ID="categoryLabel" runat="server" 
                                            CssClass="valueControl" 
                                            Visible="&lt;%# this.ReadRecordMode %&gt;"&gt;&lt;/asp:Label&gt;
                                        &lt;br /&gt;
                                    &lt;/p&gt;
                                    &lt;p class='&lt;%# this.ReadRecordMode ? "DataParagraph" : "EditModeDataParagraph" %&gt;'&gt;
                                        &lt;asp:Label ID="dateTitleLabel" runat="server" 
                                            CssClass="titleControl" 
                                            meta:resourceKey="dateTitleLabel" Text="&lt;%# this.DateFieldName %&gt;" &gt;&lt;/asp:Label&gt;
                                        &lt;asp:Label ID="dateLabel" runat="server" 
                                            CssClass="valueControl" 
                                            Visible="&lt;%# this.ReadRecordMode %&gt;"&gt;&lt;/asp:Label&gt;
                                        &lt;br /&gt;
                                    &lt;/p&gt;
                                    &lt;p class='&lt;%# this.ReadRecordMode ? "DataParagraph" : "EditModeDataParagraph" %&gt;'&gt;
                                        &lt;asp:Label ID="archiveDocumentTitleLabel" runat="server" 
                                            CssClass="titleControl" 
                                            meta:resourceKey="archiveDocumentTitleLabel" Text="&lt;%# this.ArchiveDocumentFieldName %&gt;" &gt;&lt;/asp:Label&gt;
                                        &lt;asp:Label ID="archiveDocumentLabel" runat="server" 
                                            CssClass="valueControl" 
                                            Visible="&lt;%# this.ReadRecordMode %&gt;"&gt;&lt;/asp:Label&gt;
                                        &lt;br /&gt;
                                    &lt;/p&gt;
                                    &lt;p class='&lt;%# this.ReadRecordMode ? "DataParagraph" : "EditModeDataParagraph" %&gt;' style="height:70px;" &gt;
                                        &lt;asp:Label ID="subjectTitleLabel" runat="server" 
                                            CssClass="titleControl"
                                            meta:resourceKey="subjectTitleLabel" Text="&lt;%# this.SubjectFieldName %&gt;" &gt;&lt;/asp:Label&gt;
                                        &lt;asp:Label ID="subjectLabel" runat="server" 
                                            CssClass="valueControl" 
                                            Visible="&lt;%# this.ReadRecordMode %&gt;"&gt;&lt;/asp:Label&gt;
                                        &lt;br /&gt;
                                    &lt;/p&gt;
                                    &lt;p class='&lt;%# this.ReadRecordMode ? "DataParagraph" : "EditModeDataParagraph" %&gt;' style="height:70px;" &gt;
                                        &lt;asp:Label ID="notesTitleLabel" runat="server" 
                                            CssClass="titleControl" 
                                            meta:resourceKey="notesTitleLabel" Text="&lt;%# this.NotesFieldName %&gt;" &gt;&lt;/asp:Label&gt;
                                        &lt;asp:Label ID="notesLabel" runat="server" 
                                            CssClass="valueControl" 
                                            Visible="&lt;%# this.ReadRecordMode %&gt;"&gt;&lt;/asp:Label&gt;
                                        &lt;br /&gt;
                                    &lt;/p&gt;
                                    &lt;p class='&lt;%# this.ReadRecordMode ? "DataParagraph" : "EditModeDataParagraph" %&gt;'&gt;
                                        &lt;asp:Label ID="mainDocumentNumberTitleLabel" runat="server" 
                                            CssClass="titleControl" 
                                            meta:resourceKey="mainDocumentNumberTitleLabel" Text="&lt;%# this.MainDocumentNumberFieldName %&gt;" &gt;&lt;/asp:Label&gt;
                                        &lt;asp:Label ID="mainDocumentNumberLabel" runat="server" 
                                            CssClass="valueControl" 
                                            Visible="&lt;%# this.ReadRecordMode %&gt;"&gt;&lt;/asp:Label&gt;
                                        &lt;br /&gt;
                                    &lt;/p&gt;
                                    &lt;p class='&lt;%# this.ReadRecordMode ? "DataParagraph" : "EditModeDataParagraph" %&gt;'&gt;
                                        &lt;asp:Label ID="mainDocumentDateTitleLabel" runat="server" 
                                            CssClass="titleControl" 
                                            meta:resourceKey="mainDocumentDateTitleLabel" Text="&lt;%# this.MainDocumentDateFieldName %&gt;" &gt;&lt;/asp:Label&gt;
                                        &lt;asp:Label ID="mainDocumentDateLabel" runat="server" 
                                            CssClass="valueControl" 
                                            Visible="&lt;%# this.ReadRecordMode %&gt;"&gt;&lt;/asp:Label&gt;
                                        &lt;br /&gt;
                                    &lt;/p&gt;
                                &lt;/div&gt;
                            &lt;/ContentTemplate&gt;
                        &lt;/asp:TabPanel&gt;
                        &lt;asp:TabPanel ID="relatedDocumentsTabPanel" runat="server"  
                            CssClass="Text"
                            meta:resourceKey="relatedDocumentsTabPanel" HeaderText="" &gt;
                            &lt;ContentTemplate&gt; 
                                &lt;div class="Text"&gt;
                                    &lt;asp:GridView ID="relatedDocumentsGridView" runat="server" 
                                        BorderWidth="0px" GridLines="Horizontal"
                                        AutoGenerateColumns="False" ShowHeaderWhenEmpty="true"
                                        DataKeyNames="ID"
                                        onrowdatabound="relatedDocumentsGridView_RowDataBound" 
                                        onselectedindexchanged="gridView_SelectedIndexChanged" &gt;
                                        &lt;Columns&gt;
                                            &lt;asp:BoundField DataField="ID" Visible="false" /&gt;
                                            &lt;asp:TemplateField meta:resourceKey="relatedDocumentsGridViewColorField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle RelatedDocumentColorGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle RelatedDocumentColorGridViewItem" /&gt;
                                                &lt;ItemTemplate&gt;
                                                &lt;/ItemTemplate&gt;
                                            &lt;/asp:TemplateField&gt;
                                            &lt;asp:BoundField DataField="SerialNumber" meta:resourceKey="relatedDocumentsGridViewSerialNumberField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle RelatedDocumentSerialNumberGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle RelatedDocumentSerialNumberGridViewItem" /&gt;
                                            &lt;/asp:BoundField&gt;
                                            &lt;asp:BoundField DataField="Code" meta:resourceKey="relatedDocumentsGridViewCodeField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle RelatedDocumentCodeGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle RelatedDocumentCodeGridViewItem" /&gt;
                                            &lt;/asp:BoundField&gt;
                                            &lt;asp:BoundField DataField="Subject" meta:resourceKey="relatedDocumentsGridViewSubjectField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle RelatedDocumentSubjectGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle RelatedDocumentSubjectGridViewItem" /&gt;
                                            &lt;/asp:BoundField&gt;
                                            &lt;asp:BoundField DataField="DateAsString" meta:resourceKey="relatedDocumentsGridViewCreationDateField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle RelatedDocumentCreationDateGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle RelatedDocumentCreationDateGridViewItem" /&gt;
                                            &lt;/asp:BoundField&gt;
                                        &lt;/Columns&gt;
                                        &lt;EmptyDataTemplate&gt;
                                            &lt;div&gt;
                                                &lt;a&gt; &lt;%# this.GetGlobalResourceObject("Messages", "EmptyList") %&gt; &lt;/a&gt;
                                            &lt;/div&gt;
                                        &lt;/EmptyDataTemplate&gt;
                                        &lt;PagerSettings Visible="False" /&gt;
                                        &lt;RowStyle CssClass="gridViewRow" /&gt;
                                        &lt;SelectedRowStyle CssClass="selectedGridViewRow" /&gt;
                                    &lt;/asp:GridView&gt;
                                &lt;/div&gt;
                            &lt;/ContentTemplate&gt;
                        &lt;/asp:TabPanel&gt;
                        &lt;asp:TabPanel ID="attachmentsTabPanel" runat="server"  
                            CssClass="Text"
                            meta:resourceKey="attachmentsTabPanel" HeaderText="" &gt;
                            &lt;ContentTemplate&gt; 
                                &lt;div class="Text"&gt;
                                    &lt;asp:DataList ID="documentAttachmentsDataList" runat="server" Height="78px" 
                                        RepeatDirection="Horizontal" Width="62px" RepeatColumns="5"&gt;
                                        &lt;ItemTemplate&gt;
                                            &lt;div align="center"&gt;
                                                &lt;asp:Image ID="imgAttach"  ImageUrl='&lt;%# isAvail(Eval("ATTTYPE", "~/Images/{0}.jpg"))%&gt;'  Width="100px" Height="100px" runat="server" /&gt;
                                            &lt;/div&gt;
                                            &lt;div align="center"&gt;
                                                &lt;asp:LinkButton ID="lbAttach" runat="server" Text="&lt;%# Bind('NAME') %&gt;" onclick="lbAttach_Click" Font-Size="16"&gt;&lt;/asp:LinkButton&gt;
                                                &lt;asp:Label ID="lblID" style='display:none'  runat="server" Text="&lt;%# Bind('ID') %&gt;"&gt;&lt;/asp:Label&gt;
                                            &lt;/div&gt;
                                        &lt;/ItemTemplate&gt;
                                    &lt;/asp:DataList&gt;                                    
                                    &lt;asp:GridView ID="attachmentsGridView" runat="server" 
                                        BorderWidth="0px" GridLines="Horizontal"
                                        AutoGenerateColumns="False" ShowHeaderWhenEmpty="true"
                                        DataKeyNames="ID"
                                        onrowdatabound="gridView_RowDataBound" 
                                        onselectedindexchanged="gridView_SelectedIndexChanged" &gt;
                                        &lt;Columns&gt;
                                            &lt;asp:BoundField DataField="ID" Visible="false" /&gt;
                                            &lt;asp:BoundField DataField="NAME" meta:resourceKey="attachmentsGridViewNameField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle AttachmentNameGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle AttachmentNameGridViewItem" /&gt;
                                            &lt;/asp:BoundField&gt;
                                            &lt;asp:BoundField DataField="CREATEDATE" meta:resourceKey="attachmentsGridViewCreationDateField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle AttachmentCreationDateGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle AttachmentCreationDateGridViewItem" /&gt;
                                            &lt;/asp:BoundField&gt;
                                            &lt;asp:BoundField DataField="FILENAME" meta:resourceKey="attachmentsGridViewFileField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle AttachmentFileGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle AttachmentFileGridViewItem" /&gt;
                                            &lt;/asp:BoundField&gt;
                                            &lt;asp:BoundField DataField="ATTTYPE" meta:resourceKey="attachmentsGridViewFileTypeField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle AttachmentFileTypeGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle AttachmentFileTypeGridViewItem" /&gt;
                                            &lt;/asp:BoundField&gt;
                                        &lt;/Columns&gt;
                                        &lt;EmptyDataTemplate&gt;
                                            &lt;div&gt;
                                                &lt;a&gt; &lt;%# this.GetGlobalResourceObject("Messages", "EmptyList") %&gt; &lt;/a&gt;
                                            &lt;/div&gt;
                                        &lt;/EmptyDataTemplate&gt;
                                        &lt;PagerSettings Visible="False" /&gt;
                                        &lt;RowStyle CssClass="gridViewRow" /&gt;
                                        &lt;SelectedRowStyle CssClass="selectedGridViewRow" /&gt;
                                    &lt;/asp:GridView&gt;
                                &lt;/div&gt;
                            &lt;/ContentTemplate&gt;
                        &lt;/asp:TabPanel&gt;
                        &lt;asp:TabPanel ID="imagesTabPanel" runat="server"  
                            CssClass="Text"
                            meta:resourceKey="imagesTabPanel" HeaderText="" &gt;
                            &lt;ContentTemplate&gt; 
                                &lt;table style="border:1px solid black; width:100%;" &gt;
                                    &lt;tr&gt; 
                                        &lt;td style="vertical-align:top; border-right:1px solid black; width:295px;"&gt;
                                            &lt;cc1:WebThumbnailViewer ID="documentImageWebThumbnailViewer" runat="server"
                                                Height="500px"
                                                ViewerID="documentImagesWebImageViewer"
                                                OnSelectedIndexChanged="documentImageWebThumbnailViewer_SelectedIndexChanged" /&gt;
                                        &lt;/td&gt;
                                        &lt;td style="vertical-align:top;"&gt;
                                            &lt;cc1:WebImageViewer ID="documentImagesWebImageViewer" runat="server"
                                                Height="500px" Width="100%" /&gt;
                                        &lt;/td&gt;
                                    &lt;/tr&gt;
                                &lt;/table&gt;
                            &lt;/ContentTemplate&gt;
                        &lt;/asp:TabPanel&gt;
                        &lt;asp:TabPanel ID="copiesTabPanel" runat="server"  
                            CssClass="Text"
                            meta:resourceKey="copiesTabPanel" HeaderText="" &gt;
                            &lt;ContentTemplate&gt; 
                                &lt;div class="Text"&gt;
                                    &lt;asp:GridView ID="copiesGridView" runat="server" 
                                        BorderWidth="0px" GridLines="Horizontal"
                                        AutoGenerateColumns="False" ShowHeaderWhenEmpty="true"
                                        DataKeyNames="ID"
                                        onrowdatabound="gridView_RowDataBound" 
                                        onselectedindexchanged="gridView_SelectedIndexChanged" &gt;
                                        &lt;Columns&gt;
                                            &lt;asp:BoundField DataField="ID" Visible="false" /&gt;
                                            &lt;asp:BoundField DataField="SerialNumber" meta:resourceKey="copiesGridViewSerialNumberField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle CopiesSerialNumberGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle CopiesSerialNumberGridViewItem" /&gt;
                                            &lt;/asp:BoundField&gt;
                                            &lt;asp:BoundField DataField="TargetType" meta:resourceKey="copiesGridViewTargetTypeField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle CopiesTargetTypeGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle CopiesTargetTypeGridViewItem" /&gt;
                                            &lt;/asp:BoundField&gt;
                                            &lt;asp:BoundField DataField="Target" meta:resourceKey="copiesGridViewTargetNameField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle CopiesTargetNameGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle CopiesTargetNameGridViewItem" /&gt;
                                            &lt;/asp:BoundField&gt;
                                        &lt;/Columns&gt;
                                        &lt;EmptyDataTemplate&gt;
                                            &lt;div&gt;
                                                &lt;a&gt; &lt;%# this.GetGlobalResourceObject("Messages", "EmptyList") %&gt; &lt;/a&gt;
                                            &lt;/div&gt;
                                        &lt;/EmptyDataTemplate&gt;
                                        &lt;PagerSettings Visible="False" /&gt;
                                        &lt;RowStyle CssClass="gridViewRow" /&gt;
                                        &lt;SelectedRowStyle CssClass="selectedGridViewRow" /&gt;
                                    &lt;/asp:GridView&gt;
                                &lt;/div&gt;
                            &lt;/ContentTemplate&gt;
                        &lt;/asp:TabPanel&gt;
                        &lt;asp:TabPanel ID="additionalFieldsTabPanel" runat="server"  
                            CssClass="Text"
                            meta:resourceKey="additionalFieldsTabPanel" HeaderText="" &gt;
                            &lt;ContentTemplate&gt; 
                                &lt;div class="Text"&gt;
                                    &lt;asp:GridView ID="additionalFieldsGridView" runat="server" 
                                        BorderWidth="0px" GridLines="Horizontal"
                                        AutoGenerateColumns="False" ShowHeaderWhenEmpty="true"
                                        DataKeyNames="ID"
                                        onrowdatabound="gridView_RowDataBound" 
                                        onselectedindexchanged="gridView_SelectedIndexChanged" &gt;
                                        &lt;Columns&gt;
                                            &lt;asp:BoundField DataField="ID" Visible="false" /&gt;
                                            &lt;asp:BoundField DataField="Name" meta:resourceKey="additionalFieldsGridViewNameField" HeaderText="" &gt;
                                                &lt;HeaderStyle CssClass="gridViewHeaderStyle AdditionalFieldNameGridViewHeader" /&gt;
                                                &lt;ItemStyle CssClass="gridViewItemStyle AdditionalFieldNameGridViewItem" /&gt;
                                            &lt;/asp:BoundField&gt;

                                        &lt;asp:BoundField DataField="Value" meta:resourceKey="additionalFieldsGridViewValueField" HeaderText="" &gt;
                                            &lt;HeaderStyle CssClass="gridViewHeaderStyle AdditionalFieldValueGridViewHeader" /&gt;
                                            &lt;ItemStyle CssClass="gridViewItemStyle AdditionalFieldValueGridViewItem" /&gt;
                                        &lt;/asp:BoundField&gt;
                                    &lt;/Columns&gt;
                                    &lt;EmptyDataTemplate&gt;
                                        &lt;div&gt;
                                            &lt;a&gt; &lt;%# this.GetGlobalResourceObject("Messages", "EmptyList") %&gt; &lt;/a&gt;
                                        &lt;/div&gt;
                                    &lt;/EmptyDataTemplate&gt;
                                    &lt;PagerSettings Visible="False" /&gt;
                                    &lt;RowStyle CssClass="gridViewRow" /&gt;
                                    &lt;SelectedRowStyle CssClass="selectedGridViewRow" /&gt;
                                &lt;/asp:GridView&gt;
                            &lt;/div&gt;
                        &lt;/ContentTemplate&gt;
                    &lt;/asp:TabPanel&gt;                        
                &lt;/asp:TabContainer&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/ContentTemplate&gt;
&lt;/asp:UpdatePanel&gt; 
</code></pre>

<p></p>
