LZ的实现方法有点古板了,现在都用js去实现了,很少人再去用updatepanel这些控件
下面是我实现无刷新的方法,而且删除的时候会有个图片在加载。现在一般都是这样去做了
function delAddress(id) {
if (confirm("你确定删除吗?")) {
var params = { action: 'deladdress', id: id };
$.ajax({
type: "get",
url: "../Config/Ajax.ashx",
contentType: "String",
data: params,
success: function (data) {
var list = eval("(" + data + ")");
if (list.length > 0) {
var temp = "";
$.each(list, function (i, obj) {
temp += "<li class=\"\">";
temp += " <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"width:98%\">";
temp += "<tbody>";
temp += "<tr>";
temp += "<td style=\"width:20px;\"><input type=\"radio\"
name=\"rbtnAddr\" addresstype='1' ></td>";
temp += "<td><label for=\"addr_6678375\"><strong>" + obj.Name + "</strong> " + obj.Province + "" + obj.City + "" + obj.Area + "" + obj.Address + "</label></td>";
temp += "<td style=\"width:40px\"><a
class=\"remark\" href=\"javascript:;\" onclick=\"" + obj.ID + "\">[删除]</a></td>";
temp += "</tr>";
temp += " </tbody>";
temp += "</table>";
temp += "</li>";
});
$("#ul_id").html(temp);
}
}
});
} else {
return false;
}
}