zoukankan      html  css  js  c++  java
  • 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();
                    string nickName = this.GetRequest("nickName").ToString();
                    string NewsId = this.GetRequest("NewsId").ToString();
                    try
                    {
                        switch (action)
                        {
                            case "add":
                                state = this.Db.GetState("insert into NewsComment(NewsId,NickName,Content,Ip) values(@NewsID,@NickName,@Content,@IP)", this.Db.MakeParameters("@NewsID", NewsId, "@NickName", nickName, "@Content", values, "@IP", Request.UserHostAddress.ToString())) ? ("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;
                        }
                    }
                    catch (Exception ex)
                    {
                        state = ex.Message;
                    }
                    Response.Clear();
                    Response.Write(state);
                    Response.End();
                }
            }

  • 相关阅读:
    update语句条件判断更新
    添加ll命令
    在php cli下可以使用 STDIN 来实现标准输入
    windows修改PowerShell(命令提示符)默认中文编码方式
    命令创建控制器
    windows系统关闭某个端口的服务(以443端口为例子)
    unable to create ...erroractionpreference....
    【抓包工具】使用Fiddler关于“由于目标计算机积极拒绝,无法连接。”的解决方案
    切换国内镜像:Content-Length mismatch, received 431737 bytes out of the expected 760836
    匹配函数函数备注
  • 原文地址:https://www.cnblogs.com/bestsaler/p/1835585.html
Copyright © 2011-2022 走看看