在RowDeleting()事件中 使用js脚本提示确认删除和取消,为什么按取消还是删除了数据,有什么办法修改吗?谢谢
解决方案 »
- System.Web.Configuration.PagesSection.AutoEventWireup 能在运行时用代码设置成false吗?
- 数据库备份出错:无法打开备份设备 'D:\Downloads'
- 求问c#读取xml
- 小弟遇到一个怪问题!
- javascript中如何去修改一个asp。net控件的属性
- 求去除 <img ..>html标记 方法。 c#
- xpsp2下用asp.net访问oracle数据库的问题
- datagrid显示问题。。。
- 又是怪事!Response.WriteFile的文件大小有限制!
- RDLC报表不显示了
- 区块化怎么样实现?????????在线等
- 100分请教 -- 把网页文件保存为mht文件
放在button的OnClientClick里面,OnClientClick='return confirm("确定删除吗")'
<asp:TemplateField HeaderText="删除">
<ItemTemplate>
<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="Delete"
OnClientClick="return confirm('确定删除?');" Text="删除"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
((LinkButton)e.Row.Cells[9].Controls[0]).Attributes.Add("onclick", "return confirm('你确定要删除该用户吗?');");
}
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
((BUTTON )e.Row.FindControl("butonid")).Attributes.Add("onclick", "if(!confirm('你确定要删除该用户吗?')) return false;");
}
}