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();
                }
            }

  • 相关阅读:
    负载均衡的部署方式
    nginx 负载均衡相关知识
    nginx 的模块及处理流程
    win7 下配置resin的一些tip
    Eclipse插件安装的三种方法
    win 7 下Maven环境的搭建
    Effective C++ 第二版 17)operator=检查自己 18)接口完整 19)成员和友元函数
    网络子系统54_ip协议分片重组_定位ipq
    HDU 1796How many integers can you find(简单容斥定理)
    如何关闭dell inspiron n4010的内置麦克
  • 原文地址:https://www.cnblogs.com/bestsaler/p/1835585.html
Copyright © 2011-2022 走看看