• 无刷新 checkbox列表的删除


    前台 JS :

     function ModelDelete() {
                var checkvalues = null;
                var checValue = $("#dom1").find(":checkbox");
                for (var i = 0; i < checValue.length; i++) {
                    if (checValue[i].checked == true) {
                        if (checkvalues == null) {
                            checkvalues = checValue[i].value + ",";
                        }
                        else {
                            checkvalues += checValue[i].value + ",";
                        }
                    }
                }
                if (checkvalues == null || checkvalues == "") {
                    alert("请选择删除的数据");
                }
                else {
                    checkvalues = checkvalues.substring(0, checkvalues.lastIndexOf(","));
                    $.ajax({
                        type: "POST",
                        url: 'ProComparisonsAdd.aspx/TemDetele',
                        contentType: "application/json",
                        dataType: "json",
                        data: "{TemID:'" + checkvalues + "'}",
                        cache: false,
                        success: function (response) {
                            if (response != "") {
                                $("#dom1").html(response.d);
                            }
                        },
                        error: function (data) {
                            alert("加载失败");
                        }
                    });
                }
            }

    前台 HTML :

    <input id="btn1" type="button" value="删除" onclick="ModelDelete()" style=" 70px;" />
    <div id="dom1">
        <uc1:TemPlan ID="TemPlan1" runat="server">
    </div>


    后台代码:

            [WebMethod]//删除临时信息
            public static string TemDetele(string TemID)
            {
                XieKe.BLL.tb_PlanDetail tplan = new XieKe.BLL.tb_PlanDetail();
                tplan.Delete_TemList(TemID);
                Page page = new Page();
                TemPlan tem = (TemPlan)page.LoadControl("~/Web.JYK/TemPlan.ascx");
                tem.PageSort = "ProComparisionsAdd";
                page.Controls.Add(tem);
                StringWriter writer = new StringWriter();
                //加载 当前页面 的临时数据
                HttpContext.Current.Server.Execute(page, writer, false);
                return writer.ToString();
            }
  • 相关阅读:
    PGA
    impdp导入job
    11g SQL Monitor
    Oracle buffer cache
    OGG异常处理
    Android中dp、dpi与px的关系
    android:gravity设置居中的问题
    Oracle触发器详解
    Android selector中的item的顺序
    selector在color和drawable目录下的区别
  • 原文地址:https://www.cnblogs.com/SunXiaoLin/p/3345324.html
Copyright © 2020-2023  润新知