如何在asp.net中获得确认弹出窗口
在网格内,我在网格内有一个删除按钮,并且后面有一个代码来执行删除。
<asp:TemplateField HeaderText="Edit Controls" ItemStyle-Width="15%">
<ItemTemplate>
<asp:LinkButton ID="Lnk_Delete" ToolTip="Delete Message"
CommandArgument='<%#Eval("MsgID") %>' CommandName="Delete" runat="server">
<img id="Img1" src="Styles/Images/Delete.jpg" runat="server" /></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
protected void Grid_Messagetable_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
}
一切正常,如何在执行删除之前弹出确认窗口。
Inside the grid I have a delete button inside a grid and have a code behind to perform the delete.
<asp:TemplateField HeaderText="Edit Controls" ItemStyle-Width="15%">
<ItemTemplate>
<asp:LinkButton ID="Lnk_Delete" ToolTip="Delete Message"
CommandArgument='<%#Eval("MsgID") %>' CommandName="Delete" runat="server">
<img id="Img1" src="Styles/Images/Delete.jpg" runat="server" /></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
protected void Grid_Messagetable_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
}
Everything works fine how to get a confirm pop up before the delete is performed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用
OnClientClick
属性,如以下文章中所示:You could use the
OnClientClick
property as shown in the following article:尝试添加
Try adding