Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Modelpopup extender showing below script error 



Uncaught TypeError: Cannot read property '_events' of null
    
at Sys.UI.DomEvent.addHandler (ScriptResource.axd?d=co5QUPy2Hub1TZ9kFn66FaXSuHubiNR6E4Wd-9hfFsA_PvE4i61VYpBo1xSbRUtPX7PuVHKiRDqCYe…:5)
    
at AjaxControlToolkit.ModalPopupBehavior.initialize (ScriptResource.axd?d=jgdlKh2MJXzFMdkd3f91tVrb_Pps7ZOWCLcBucCntGpYKcBXsTg6wzQ4A2HSbQ-djIn0K9QGPlc9HQ…:1)
    
at AjaxControlToolkit.ModalPopupBehavior.endUpdate (ScriptResource.axd?d=co5QUPy2Hub1TZ9kFn66FaXSuHubiNR6E4Wd-9hfFsA_PvE4i61VYpBo1xSbRUtPX7PuVHKiRDqCYe…:5)
  
  at Sys.Component.create (ScriptResource.axd?d=co5QUPy2Hub1TZ9kFn66FaXSuHubiNR6E4Wd-9hfFsA_PvE4i61VYpBo1xSbRUtPX7PuVHKiRDqCYe…:5)
    
at Array.<anonymous> (GenerateInvoice.aspx:1040)
    at ScriptResource.axd?d=co5QUPy2Hub1TZ9kFn66FaXSuHubiNR6E4Wd-9hfFsA_PvE4i61VYpBo1xSbRUtPX7PuVHKiRDqCYe…:5
  
  at Sys._Application._raiseInit (ScriptResource.axd?d=co5QUPy2Hub1TZ9kFn66FaXSuHubiNR6E4Wd-9hfFsA_PvE4i61VYpBo1xSbRUtPX7PuVHKiRDqCYe…:5)
  
  at Sys._Application.initialize (ScriptResource.axd?d=co5QUPy2Hub1TZ9kFn66FaXSuHubiNR6E4Wd-9hfFsA_PvE4i61VYpBo1xSbRUtPX7PuVHKiRDqCYe…:5)
    
at b (ScriptResource.axd?d=co5QUPy2Hub1TZ9kFn66FaXSuHubiNR6E4Wd-9hfFsA_PvE4i61VYpBo1xSbRUtPX7PuVHKiRDqCYe…:5)
    
at HTMLDocument.a (ScriptResource.axd?d=co5QUPy2Hub1TZ9kFn66FaXSuHubiNR6E4Wd-9hfFsA_PvE4i61VYpBo1xSbRUtPX7PuVHKiRDqCYe…:5)


What I have tried:

I have Done-
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true" ScriptMode="Release" AsyncPostBackTimeout="100">
            
                    </asp:ScriptManager>

<asp:LinkButton ID="lnkFake" runat="server" />
                        <asp:ModalPopupExtender ID="mpeTimeout" BehaviorID="mpeTimeout" runat="server" PopupControlID="pnlPopup"
                            TargetControlID="lnkFake" OkControlID="btnYes" CancelControlID="btnNo" BackgroundCssClass="modalBackground"
                            OnOkScript="ResetSession()">
                        </asp:ModalPopupExtender>
                        <asp:Panel ID="pnlPopup" runat="server" CssClass="modalPopup" Style="display: none">
                            <div class="header">
                                Session Expiring!
                            </div>
                            <div class="body">
                                Your Session will expire in <span id="seconds"></span> seconds.<br />
                                Do you want to reset?
                            </div>
                            <div class="btnSection" align="right">
                                <asp:Button ID="btnYes" runat="server" Text="OK" CssClass="yes" />
                               <%-- <asp:Button ID="btnNo" runat="server" Text="No" CssClass="no" />--%>
                            </div>
                        </asp:Panel>
Posted
Updated 20-Nov-22 19:49pm

if you look at the code closely. The ModalPopupExtender contain the property CancelControlID="btnNo" but that button was being commented out
C#
<%-- <asp:Button ID="btnNo" runat="server" Text="No" CssClass="no" />--%>

So, to get rid of the error, either remove the CancelControlID="btnNo" from ModalPopupExtender or un-comment the btnNo code.
 
Share this answer
 
Very Good
Bryian Tan
. Your solution save my time. Thanks
 
Share this answer
 
Comments
Richard Deeming 3-Jul-20 7:27am    
If you want to reply to a solution, click the "Have a Question or Comment?" button under that solution and post a comment.

Do not post your comment as a new "solution".
Delete the visible="false" property in panel
 
Share this answer
 
Comments
Richard Deeming 21-Nov-22 6:58am    
There is no such property set in the question; your post is the only thing on this page which mentions the visible property.

This question was solved 5½ years ago. Stick to answering new questions unless you have something new and interesting to add to the discussion.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900