0

Modal not showing up when show is called, also error on loading page. Attaching code below, can anyone help me discover my syntax / logic issues here?

NOTE: Did some research on this before posting, some claimed it can be an issue of where the modal is placed on the page in relation to the update panel I am using. I have tried different placements of the modal extender and I also tried removing the update panel all together in hopes to at least see the modal show, no go...same issue. So with that, the issue shouldnt be around the use of the update panel...

Any help is greatly appreciated!!! :)

Here is the error:
icrosoft JScript runtime error: Sys.ArgumentNullException: Value cannot be null.
Parameter name: elements


and the code...

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Delete.aspx.vb" Inherits="CATS.Delete" MasterPageFile="~/MasterPage/CatsMaster.Master" %>
<%@ Register TagName="Delete" TagPrefix="ctrlDel" Src="~/Controls/Delete.ascx" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajx" %>
<%--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
--%>
<asp:Content ID="content" ContentPlaceHolderID="Main" runat="server">
  
    
    <asp:UpdatePanel ID="DeletePgUpdate" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <ajx:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </ajx:ToolkitScriptManager>
        <table style="height:350px;" border="5px">
        <tr>
            <td><ctrlDel:Delete ID="delCtrl" runat="server" /></td>
        </tr>
        <tr>
            <td><asp:LinkButton ID="btnNext" runat="server" Text="Next"></asp:LinkButton></td>
        </tr>
        </table>
    
    
    
 <!-- TODO: use small modal for delete -->   
<asp:Panel ID="pnlModal" runat="server" Style="display:none">
<div id="delModal" runat="server" class="tableModal" visible="false">
<div style="padding:30px 0 0 1020px">
<asp:LinkButton id="btnClose" runat="server" CssClass="modalClose"></asp:LinkButton>
</div>
<div style="padding:0px 0px 0px 50px; overflow:auto; height:500px;">
<asp:ListView ID="modalLstView" runat="server">
<LayoutTemplate>
     <table id="table" runat="server" border="4" cellpadding="1" frame="border">
         <tr runat="server" id="delLayout">
            <td><asp:Label ID="lblTagNum" runat="server" Text="<%$AppSettings:lblTagNum %>"></asp:Label></td>
         </tr>
         
     <tr id="itemPlaceholder" runat="server">
     </tr>
 </table>
</LayoutTemplate>


<ItemTemplate>
    <tr>
        <td>
            <asp:TextBox ID="txtTagNum" runat="server" TabIndex="10"></asp:TextBox>
        </td>
    </tr>
</ItemTemplate>

</asp:ListView>
</div>
</div>
</asp:Panel>

<asp:Button ID="btn" runat="server" style="display:none" />
<ajx:ModalPopupExtender ID="Modal" runat="server" PopupControlID="pnlModal" TargetControlID="btn" 
CancelControlID="btnClose" BackgroundCssClass="modalBackground" DropShadow="true"></ajx:ModalPopupExtender>


<!-- BTN for submit, temp for wiring up controls, needs to be wrapped in modal -->
<asp:LinkButton ID="btnSubmit" runat="server" Text="Submit"></asp:LinkButton>

    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
2
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by dabobrow
0

I found my issue...

Really stupid one @ that. I had been playing around with different things while troubleshooting another issue and had set the visibility to false as so:

<div id="delModal" runat="server" class="tableModal" visible="false">

When visibility is set to false that div is not accessible on page load since the control is not even actually rendered.

Since the AJAX modalextender makes references to controls within that DIV, I get the error I described above...

Thanks for the reply, you got my brain working again at least. What a silly mistake...

0

I found my issue...

Really stupid one @ that. I had been playing around with different things while troubleshooting another issue and had set the visibility to false as so:

<div id="delModal" runat="server" class="tableModal" visible="false">

When visibility is set to false that div is not accessible on page load since the control is not even actually rendered.

Since the AJAX modalextender makes references to controls within that DIV, I get the error I described above...

What a silly mistake...

0

I clicked it...twice, can't help it if daniweb is broken :)

0

OK Dabobrow, sorry. Some people just don't bother, but you are clearly not one of them.

Daniweb is certainly behaving oddly today. Under IE6 on one computer almost nothing works, while under IE7 on another machine, everything works fine - maybe faster than normal in fact. Maybe they roll out new stuff on Sundays or something.

Stay cool. :cool:
Airshow

Edited by Airshow: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.