How to use ModalPopUpExtender in GridView?
<p>I have following tables in my database:</p>

<p><strong>SuggestionsLog Table:</strong> ID, Title, Description. </p>

<p><strong>Employee Table:</strong> Username, Name</p>

<p><strong>Divisions Table:</strong> DivisionCode, DivisionName</p>

<p>I want to show table that consists of SuggestionID, SuggestionTitle, EmployeeName and DivisionName only and when the user clicks on the SuggestionTitle, a pop-up window will be displayed with the description of the suggestion.</p>

<p>Since I am ASP.NET beginner developer, I tried to follow <a href="http://www.csharpaspnetarticles.com/2011/04/ajax-modalpopextender-gridview-master.html" rel="nofollow">this tutorial</a> to get it but I failed. </p>

<p>What I did is the following:</p>

<p><strong>ASP.NET Code:</strong> </p>

<pre><code>&lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
    &lt;ContentTemplate&gt;
        &lt;asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" 
            DataSourceID="SqlDataSource1" OnRowDataBound="GridView1_RowDataBound"&gt;
            &lt;Columns&gt;
                &lt;asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" /&gt;
                &lt;asp:TemplateField HeaderText="Title"&gt;
                    &lt;ItemTemplate&gt;
                        &lt;asp:LinkButton runat="server" ID="lnkSuggestionTitle"
                                        Text='&lt;%#Eval("Title") %&gt;' 
                                        OnClick="lnkSuggestionTitle_Click"&gt;
                                        &lt;/asp:LinkButton&gt;
                    &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
                &lt;%--&lt;asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /&gt;--%&gt;
                &lt;asp:BoundField DataField="Description" HeaderText="Description" 
                    SortExpression="Description" /&gt;
                &lt;asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /&gt;
                &lt;asp:BoundField DataField="Username" HeaderText="Username" 
                    SortExpression="Username" /&gt;
                &lt;asp:BoundField DataField="DivisionName" HeaderText="Division" 
                    SortExpression="DivisionName" /&gt;
            &lt;/Columns&gt;
        &lt;/asp:GridView&gt;

        &lt;asp:Button runat="server" ID="btnModalPopUp" style="display:none" /&gt;

        &lt;AjaxToolkit:ModalPopupExtender ID="modalPopUpExtender1" 
                                        runat="server" TargetControlID="btnModalPopUp" PopupControlID="pnlPopUp" BackgroundCssClass="modalBackground" 
                                        OkControlID="btnOk" X="20" Y="100"&gt;
        &lt;/AjaxToolkit:ModalPopupExtender&gt;

        &lt;asp:Panel runat="server" ID="pnlPopUp" CssClass="confirm-dialog"&gt;
            &lt;asp:GridView ID="GridView2" runat="server"&gt;
            &lt;/asp:GridView&gt;
        &lt;/asp:Panel&gt;

        &lt;/ContentTemplate&gt;
        &lt;/asp:UpdatePanel&gt;
        &lt;br /&gt; 

        &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="&lt;%$ ConnectionStrings:testConnectionString %&gt;" 
            SelectCommand="SELECT     dbo.SafetySuggestionsLog.ID, dbo.SafetySuggestionsLog.Title, dbo.SafetySuggestionsLog.Description, dbo.employee.Name, dbo.SafetySuggestionsLog.Username, 
                      dbo.Divisions.DivisionName
FROM         dbo.employee INNER JOIN
                      dbo.SafetySuggestionsLog ON dbo.employee.Username = dbo.SafetySuggestionsLog.Username INNER JOIN
                      dbo.Divisions ON dbo.employee.DivisionCode = dbo.Divisions.SapCode"&gt;
        &lt;/asp:SqlDataSource&gt;
</code></pre>

<p><strong>Code-Behind:</strong></p>

<pre><code>protected void lnkSuggestionTitle_Click(object sender, EventArgs e)
    {
        LinkButton lnkSuggestionTitle = sender as LinkButton;
        string strSuggestionTitle = lnkSuggestionTitle.Text;

        string strConnectionString = ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString;
        string strSelect = "SELECT ID, Title, Description FROM  dbo.SafetySuggestionsLog";
        SqlConnection sqlCon = new SqlConnection();
        sqlCon.ConnectionString = strConnectionString;
        SqlCommand cmdSuggestionDetails = new SqlCommand();
        cmdSuggestionDetails.Connection = sqlCon;
        cmdSuggestionDetails.CommandType = System.Data.CommandType.Text;
        cmdSuggestionDetails.CommandText = strSelect;
        cmdSuggestionDetails.Parameters.AddWithValue("@Title", strSuggestionTitle);
        sqlCon.Open();

        SqlDataReader dReader = cmdSuggestionDetails.ExecuteReader();
        GridView1.DataSource = dReader;
        GridView1.DataBind();
        sqlCon.Close();
        modalPopUpExtender1.Show();
    }
</code></pre>

<p>Everything is going well and smooth, but in the website, when I clicked on one of the titles, I did not get the ModalPopUp. Also, I got an error notification at the left bottom corner in the Internet Explorer browser, which when I opened it, it gave me the following description:</p>

<p>**</p>

<blockquote>
  <p>Sys.ArgumentNullException: Value cannot be null. Parameter name:
  elements</p>
</blockquote>

<p>** </p>

<p>I don't know why this is happened. Any help please?</p>
