1、方式一:访问.aspx
客户端:
function Del(Id) { if (confirm("确认要删除?")) { $.ajax({ type: "Post", url: "FormSet.aspx/Del", data: "{'Id':'" + Id + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { ShowTip("删除成功!刷新后显示", "success"); }, error: function (err) { ShowTip("不能删除!此字段已经投入使用", "error"); return false; } }); }}
服务器端:
[WebMethod] public static string GetFormSet(string str) { StringBuilder sb = new StringBuilder(); Listlist = new BLL.w_FromSet().GetList("where FromSet_FlowType_Id=" + str + ""); foreach (Model.w_FromSet model in list) { sb.Append(" "); } if (str == "0") { sb.Insert(0, " "); } return sb.ToString(); }