我有以下代码:
<asp:Button ID="btnDelete" runat="server" Text="Delete Report" OnClientClick="return confirm ('This will delete the report. Continue?');" OnClick="btnDelete_Click" />
protected void btnDelete_Click(object sender, EventArgs e)
{
// I have code here but it never fires
}
一旦用户点击OK,我如何获取实际删除的服务器端脚本。
答案 0 :(得分:0)
你不能错过为按钮设置事件处理程序吗?您有几个选项,其中一个可能是
<asp:Button ID="btnDelete" runat="server" Text="Delete Report" OnClientClick="return confirm ('This will delete the report. Continue?');" OnClick="btnDelete_Click" />
请参阅OnClick属性。