您的位置:首页 > Web前端 > JavaScript

Js中$.ajax调用一般处理程序(.ashx)

2017-01-17 17:30 197 查看
     $.ajax({

                    type: "post",

                    url: "/tools/ActApply.ashx",

                    data: "txthdmoney=" + $.trim($("#hdmoneyx")[0].value)+"&sxf=2",

                    success: function (result) {                        

                    }

                });

 

.ashx后台接收数据

        protected decimal hdmoney;

        protected decimal hdsxf;

        /// <summary>

        /// 请求处理

        /// </summary>

        /// <param name="context"></param>

        public void ProcessRequest(HttpContext context)

        {

            Withdrawal withdra = new Withdrawal();

            context.Response.ContentType = "text/plain";

            hdmoney = Convert.ToDecimal(context.Request.Params["txthdmoney"].ToString());

            hdsxf = Convert.ToDecimal(context.Request.Params["sxf"].ToString());

            SaveAct();

        }

        public bool IsReusable

        {

            get

            {

                return false;

            }

        }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: