小兔网

 1:定义删除按钮

<asp:Button ID="btnDelete" runat="server" Text="删除" OnClientClick="javascript: return ShowMessage()"

OnClick="btnDelete_OnClick" CommandArgument='<%# Eval("Id") %>' />

 
<script language="javascript" type="text/javascript" > 

function ShowMessage() {
return confirm("要删除该项吗?");
}
</script>