title: (ASP.NET) In grid view, how can I make the selected row data show up on a confirmation dialog box?
body: <p>I tried the following code on a <code>linkbutton onClientClick</code>. But it is calling an error.</p>
  
  <pre><code>return confirm('""Are you sure you want to report on the  &amp; **row.Cells(3).Text** &amp;  vs  &amp; **row.Cells(4).Text** &amp; game, at the  &amp; **row.Cells(5).Text** &amp;  stadium. For  &amp; **row.Cells(2).Text** &amp;  on the  &amp; **row.Cells(1).Text &amp;** " ."'); 
  </code></pre>
  
  <p>Below is the rest of the code.</p>
  
  <pre><code>&lt;asp:gridview id="FixtureGridView" runat="server"
                autogeneratecolumns="False"
                datasourceid="matches"
                height="140px" 
                width="800px" 
                onselectedindexchanged="FixtureGridView_SelectedIndexChanged"&gt;
                &lt;columns&gt;
                    &lt;asp:commandfield showselectbutton="True" /&gt;
                    &lt;asp:boundfield datafield="date" headertext="date" sortexpression="date" readonly="True" /&gt;
                    &lt;asp:boundfield datafield="kick-off time" headertext="kick-off time" sortexpression="kick-off time" /&gt;
                    &lt;asp:boundfield datafield="home team" headertext="home team" sortexpression="home team" /&gt;
                    &lt;asp:boundfield datafield="away team" headertext="away team" sortexpression="away team" /&gt;
                    &lt;asp:boundfield datafield="stadium" headertext="stadium" sortexpression="stadium" /&gt;
                    &lt;asp:TemplateField&gt;
                        &lt;ItemTemplate&gt;
                            &lt;asp:LinkButton ID="LinkButton1" Runat="server"
                                            OnClientClick="return confirm('Are you sure you want to report on this game');"
                                            CommandName="Select"&gt;
                            Report
                            &lt;/asp:LinkButton&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;
  </code></pre>