GridView 服务端控件添加 js
针对服务端控件的 CommandField “Delete” 添加 js

$("#GridView1").find("a").each(
function() {
var text = $(this).html();
if (text == "Delete") {
var td = $(this).parent().parent().children().eq(0);
$(this).on("click", function() {
if (confirm("Delete the "+$(td).html()+"?")) {
return true; // 允许执行后台代码
}
else {
return false; //// 不允许执行后台代码
}
});
}
}
);

浙公网安备 33010602011771号