首先将按钮那一列转化为模版,然后在其属性里加入下面的js语句,就能弹出一个确认窗口。
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select"
Text="选择" >
</asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete" Text="删除"
OnClientClick="return confirm('Are you sure you want'+'to delete this record?')" >
</asp:LinkButton>
</ItemTemplate>