$.ajax({
                type: 'POST',
                url: 'AddressManager.aspx/GetProvince',//AddressManager.aspx当前页面
                data: '{cache:0}',
                dataType: 'json',
                contentType: 'application/json; charset=utf-8',
                cache: false,
                async: false,
                success: function (data) {
                    var arr = data.d;
                    $("#selProvince").empty();
                    $("#selProvince").append("<option selected='selected' value=''>省</option>");
                    for (var i = 0; i < arr.length ; i++) {
                        $("#selProvince").append($("<option></option>").val(arr[i]).html(arr[i]));
                    }
                    $("#selCity").empty();
                    $("#selArea").empty();
                    $("#selCity").append("<option selected='selected' value=''>市</option>");
                    $("#selArea").append("<option selected='selected' value=''>区</option>");
                },
                error: function (event, request, settings) {
                    // window.location.reload();
                }
            });

  

        [WebMethod]
        public static List<string> GetProvince(int cache)
        {
            ProvinceCityAreaBLL provinceCityAreaBLL = new ProvinceCityAreaBLL();
            DataSet ds = provinceCityAreaBLL.GetProvince();
            List<string> list = ds.Tables[0].AsEnumerable().Select(x => x.Field<string>("province")).ToList();
            return list;
        }

  

相关文章:

  • 2021-12-06
  • 2021-12-12
  • 2021-11-19
  • 2021-09-23
  • 2022-12-23
猜你喜欢
  • 2021-12-15
  • 2021-07-24
  • 2022-12-23
  • 2021-11-29
  • 2021-10-22
相关资源
相似解决方案