title: Modal Popup Error
body: <p>I have a DataList that has a link button and I want this link button envoke a modal popup. I've copied the mpe code from another application where it works in a gridview. The error is thrown as soon as page is openned and each time the link button is clicked. The error is thrown in the ScriptResource file: "Microsoft JScript runtime error: Sys.ArgumentNullException: Value cannot be null.
  Parameter name: elements". I understand something has null value but not sure what. Page has over a thousand lines so I'll just paste the part I'm working on.</p>
  
  <pre><code>&lt;ItemTemplate&gt;
                  &lt;tr  class="AssetMngnt-trHeaderRow_bgColor"&gt;
                      &lt;td valign="top"&gt;
                          &lt;asp:Label ID="lblIdent" runat="server" Text='&lt;%# Eval("Printer_Ident") %&gt;' Visible="false"&gt;&lt;/asp:Label&gt;                            
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;asp:LinkButton ID="lbEdit" runat="server" CausesValidation="False" CommandName="Select" Text="Edit" /&gt;
                      &lt;/td&gt;
                      &lt;td valign="top" nowrap&gt;
                          &lt;asp:Label ID="lblName" Text='&lt;%# Eval("Network_Name") %&gt;' runat="server" /&gt; 
                      &lt;/td&gt;
                      &lt;td valign="top"&gt;
                          &lt;asp:LinkButton ID="lbPrinterModel"
                              runat="server" CausesValidation="False" CommandName="Select" CommandArgument="ShowAsset"
                              Text='&lt;%# Eval("Printer_Mfg") + " " + (string)Eval("Printer_Model") %&gt;' /&gt;
                      &lt;/td&gt;
                      &lt;td valign="top"&gt;
                          &lt;asp:Label ID="lblLocation" Text='&lt;%# Eval("Location") %&gt;' runat="server" /&gt; 
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;asp:LinkButton ID="LinkButton1"
                              runat="server" CausesValidation="False" CommandName="Select" CommandArgument="IssueToners"
                              Text="Issue Toners" /&gt;
  
                          &lt;asp:Button runat="server" ID="btnShowPopup" style="display:none" /&gt;
  
                          &lt;ajaxToolkit:ModalPopupExtender runat="server" id="mpeIssueToners"
                                       TargetControlID="btnShowPopup"
                                       PopupControlID="pnlFvIssueTonersModal"
                                       CancelControlID="UpdateCancelButton"
                                       BackgroundCssClass="modalBackground" &gt;
                          &lt;/ajaxToolkit:ModalPopupExtender&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/ItemTemplate&gt;
  
  
  &lt;asp:Panel runat="server" ID="pnlFvIssueTonersModal" Visible="true" style="display:none"&gt;
   &lt;asp:Panel runat="server" ID="pnlFvIssueToners" Visible="true"&gt;
  
      &lt;div id="AssetMngnt-FloatLeft_alt""&gt;
          &lt;!-- ISSUE TONERS FORM VIEW ******************************************************************************** --&gt;   
  
          &lt;asp:FormView ID="fvIssueCartridges" runat="server" DataSourceID="ODSIssueCartridges"                               
              OnItemUpdating="fvIssueCartridges_OnItemUpdating" OnItemUpdated="FormView1_Display_Update_Msg" 
              EnableViewState="False" 
              EmptyDataRowStyle-CssClass="AssetMngnt-panelRO" &gt;
                  &lt;EditItemTemplate&gt;
  
                  &lt;/EditItemTemplate&gt;
          &lt;/asp:FormView&gt;
  
          &lt;!-- END ISSUE TONERS FORM VIEW **************************************************************************** --&gt;
      &lt;/div&gt;
  
   &lt;/asp:Panel&gt;       
      &lt;ajaxToolKit:ModalPopupExtender ID="ModalPopupExtender1" BehaviorID="mdlPopup" runat="server" 
              TargetControlID="div" PopupControlID="div" CancelControlID="btnNo" 
              OnCancelScript="cancelClick();" BackgroundCssClass="modalBackground" /&gt;
      &lt;div id="div" runat="server" align="center" class="confirm" style="display:none"&gt;
          &lt;asp:Label Text="Form is empty - empty records are not allowed." 
              ForeColor="#000000" runat="server" ID="Label3" /&gt;&lt;br /&gt;
          &lt;asp:Button ID="btnNo" runat="server" Text="Ok" Width="50px" /&gt;
      &lt;/div&gt;
  &lt;/asp:Panel&gt;
  </code></pre>
  
  <p>The ModalPopupExtender1 takes care of things inside the FormView. </p>
  
  <p>Thanks,
  Risho</p>