Ajax处理函数模板

 public void IsAjaxFunction()
        {
            string state = "0";
            string isAjax = this.GetRequest("isAjax").ToLower();

            if (isAjax == "true")
            {
                string action = this.GetRequest("action").ToString();
                string values = this.GetRequest("values").ToString();
                switch (action)
                {
                    case "repost":
                        state = this.Db.GetState("update Product set FlushTime=getdate() where P_ID=@P_ID", new System.Data.SqlClient.SqlParameter("@P_ID", values)) ? ("1") : ("0");
                        break;
                    case "shanchu":
                        state = this.Db.GetState("delete from  Product where P_ID=@P_ID", new System.Data.SqlClient.SqlParameter("@P_ID", values)) ? ("1") : ("0");
                        break;
                    default:
                        break;
                }
                Response.Clear();
                Response.Write(state);
                Response.End();
            }
        }

相关文章:

  • 2022-12-23
  • 2022-03-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2022-01-08
猜你喜欢
  • 2021-12-09
  • 2021-06-03
  • 2022-03-06
  • 2021-12-28
  • 2021-12-08
  • 2022-03-06
相关资源
相似解决方案