zoukankan      html  css  js  c++  java
  • JS FormData Post WebApi

            var dataObj = {
                "cateId": 7,
                "pageCount":10,
                "pageNum":0,
                "S_CaoZuoR":"sclgs",
                "B_IsShow":1
            };
            postFormData(dataObj);    



        function postFormData(dataObj) {

            var formData = new FormData();
            for (var key in dataObj) {
                formData.append(key, dataObj[key]);
            }

            $.ajax({
                type: "POST",
                url: url,
                cache: false,
                processData: false,
                contentType: false,
                data: formData,
                success: function (data) {
                    return data;
                },
                error: function (xhr, state, err) {
                    alert(JSON.stringify(err));
                }
            });

        }
     [HttpPost]
            [Route("content/SelectPageByAdmin3")]
            public IEnumerable<PW_Content> SelectPageByAdmin3()
            {
                int cateId = Convert.ToInt32(HttpContext.Current.Request.Params["cateId"]);
                int pageCount = Convert.ToInt32(HttpContext.Current.Request.Params["pageCount"]);
                int pageNum = Convert.ToInt32(HttpContext.Current.Request.Params["pageNum"]);
                string S_CaoZuoR = HttpContext.Current.Request.Params["S_CaoZuoR"].ToString();
                int B_IsShow = Convert.ToInt32(HttpContext.Current.Request.Params["B_IsShow"].ToString());
    
                return Service.SelectPageByAdmin2(cateId, pageCount, pageNum, S_CaoZuoR, B_IsShow);
            }
  • 相关阅读:
    Mybatis批量插入
    easyui中datagrid常见功能
    mysql下载和安装方式
    Mybatis注意事项
    ol3对地图上某些特定的经纬度进行标注
    ol3开发离线地图
    java利用poi生成excel文件后下载本地
    log4j的基本使用方法
    tomcat8.5之后版本,远程无法登录管理页面
    但构造函数返回对象时
  • 原文地址:https://www.cnblogs.com/0-0snail/p/12985846.html
Copyright © 2011-2022 走看看