我在ClientClick上试用了以下代码。 但是,这是一大错误。
return confirm( ""Are you sure you want to report on the & **row.Cells(3).Text** & vs & **row.Cells(4).Text** & game, at the & **row.Cells(5).Text** & stadium. For & **row.Cells(2).Text** & on the & **row.Cells(1).Text &** " ." );
下面是该法的其余部分。
<asp:gridview id="FixtureGridView" runat="server"
autogeneratecolumns="False"
datasourceid="matches"
height="140px"
width="800px"
onselectedindexchanged="FixtureGridView_SelectedIndexChanged">
<columns>
<asp:commandfield showselectbutton="True" />
<asp:boundfield datafield="date" headertext="date" sortexpression="date" readonly="True" />
<asp:boundfield datafield="kick-off time" headertext="kick-off time" sortexpression="kick-off time" />
<asp:boundfield datafield="home team" headertext="home team" sortexpression="home team" />
<asp:boundfield datafield="away team" headertext="away team" sortexpression="away team" />
<asp:boundfield datafield="stadium" headertext="stadium" sortexpression="stadium" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" Runat="server"
OnClientClick="return confirm( Are you sure you want to report on this game );"
CommandName="Select">
Report
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>