Thursday, 30 January 2014

AJAX - Modal Popup Extender - how to fix error _foregroundElement.parentNode' is null or not an object

Replace


<cc1:ModalPopupExtender ID="ModalPopupExtender4" runat="server"    TargetControlID="LinkButton1" PopupControlID="Panel1">
</cc1:ModalPopupExtender>
 <div id="Test" visible="false" runat="server">
 <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton>
 </div>

 <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" ScrollBars="Horizontal"
                OnLoad="Panel1_Load" >
   <div class="modalWholePage">
   </div>

-- code behind
    protected void ShowMoreSearchOptions_Click(object sender, EventArgs e)
    {
        Test.Visible = true;
    }

With
<cc1:ModalPopupExtender ID="ModalPopupExtender4" runat="server" TargetControlID="LinkButton1" PopupControlID="Panel1">
</cc1:ModalPopupExtender>


 <div id="Test" visible="false" runat="server">
 <asp:LinkButton ID="LinkButton1" runat="server" Visible ="false">LinkButton</asp:LinkButton>
 </div>


 <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" ScrollBars="Horizontal"
                OnLoad="Panel1_Load" Style="display: none">
 <div class="modalWholePage">
 </div>


-- code behind
    protected void ShowMoreSearchOptions_Click(object sender, EventArgs e)
    {
        Test.Visible = true;
        LinkButton1.Visible = true;
    }

No comments:

Post a Comment