• ajax-C#


     $(document).ready(function(){
        $("#month").change(function () {
            var yearSelect = $("#year").find("option:selected").val();
            var monthSelect = $("#month").find("option:selected").val();
            var jsonFormat = "{year:" + yearSelect + ",month:" + monthSelect + "}";
            $.ajaxWebService("GetInfo", jsonFormat, function (data) {
            });
        });
        });
    
        $.ajaxWebService = function (url, dataparam, datasuccess) {
            $.ajax({
                type: "POST",
                dataType: "json",
                contentType: "application/json",
                url: url,
                data: dataparam,
                success: datasuccess,
                error: function (a, b, c) { }
            });
        }
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    
    namespace NXT.Areas.Anm.Controllers
    {
        public class MonthlyReportController : Controller
        {
            //
            // GET: /Anm/MonthlyReport/
    
            public ActionResult Index()
            {
                string year = Request["year"];
                string month = Request["month"];
                return View();
            }
    
            [HttpPost]
            public JsonResult GetInfo(string year,string month)
            {
                //***
                var data = new
                {
                    id = 1,
                    text = "sdfsdfsdfsdf"
                };
                return Json(data, JsonRequestBehavior.AllowGet);
            }
        }
    }
  • 相关阅读:
    Hyperledger Fabric:最简单的方式测试你的链码
    ETCD:客户端v3
    ETCD:gRPC命名与发现
    ETCD:HTTP JSON API通过gRPC网关
    ETCD:TLS
    ETCD:基于角色的访问控制
    ETCD:多机上的集群
    ETCD:etcd网关
    ETCD:在容器中运行etcd集群
    ETCD:词汇表
  • 原文地址:https://www.cnblogs.com/hellowzd/p/4468354.html
Copyright © 2020-2023  润新知