zoukankan      html  css  js  c++  java
  • 在asp页面中使用ajax调用asp.net页面处理数据时页面数据时加上Math.random()

    在asp页面中使用ajax调用asp.net页面处理数据时页面数据时加上Math.random(),

       function AuditQualication(do_type, quaid, ad_id, c_id) {
             //do_type=1(通过) 2不通过
             alert(do_type + "&&" + ad_id + "&&" + quaid);
             $.ajax({
                 type: "Get",
                 url: "admin_invoiceReceipt_Qualication_AuditAjax.aspx",
                 dataType: "json",
                 data: "do_type=" + do_type + "&quaid=" + quaid + "&ad_id=" + ad_id + "&c_id=" + c_id+"&"+ Math.random(),
                 success: function (msg) {
                     location.reload();
                 },
                 complete: function (XMLHttpRequest, textStatus) {               
                 },
                 error: function () {
                     //错误处理
                     return false;
                 }
             });

         }

    这样asp.net页面才不会认为你这是之前的同一个界面,而认为是首次加载

      protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string do_type = Request.QueryString["do_type"].ToString();
                string quaid = Request.QueryString["quaid"].ToString();
                string ad_id = Request.QueryString["ad_id"].ToString();
                string c_id = Request.QueryString["c_id"].ToString();
                SubAudit_receipt_qualication(do_type, quaid, ad_id, c_id);
            }
        
        }
        public string SubAudit_receipt_qualication(string do_type, string quaid, string ad_id, string c_id)
        {
               //数据处理

        }

       记下来,希望自己要注意细节,重视细节的使用,不要在小细节上耽误时间

  • 相关阅读:
    XML和JSON两种数据交换格式的比较
    Mysql主从安装配置
    mysqldump命令之数据库迁移
    报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost
    Java Map 排序
    Jeff Dean 光辉事迹
    动态创建的link标签不会阻塞其后动态创建的script的加载与执行
    why?
    mongo find-matches value
    mongo find-in,or,and,not
  • 原文地址:https://www.cnblogs.com/huizi/p/3495106.html
Copyright © 2011-2022 走看看