zoukankan      html  css  js  c++  java
  • [转载]DropDownList三级菜单联动源码

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Insus.NET;
    
    public partial class MultiDropDownListSelectDemo : System.Web.UI.Page
    {
        Address objAddress = new Address();
        ListControlUtility objLcu = new ListControlUtility();
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Data_Binding();
            }
        }
    
        private void Data_Binding()
        {
            objLcu.DropDownListParse(this.DdlProvince, objAddress.GetProvince(), "ProvinceName", "ProvinceId", "--选择省--");
    
            this.DdlCity.Items.Add(new ListItem("--选择市--"));
            this.DdlDistrict.Items.Add(new ListItem("选择县或区"));
    
        }
    
        protected void DdlProvince_SelectedIndexChanged(object sender, EventArgs e)
        {
            string sltValue = this.DdlProvince.SelectedItem.Value;
            if (string.IsNullOrEmpty(sltValue))
            {
                sltValue = "0";
            }
    
            objLcu.DropDownListParse(this.DdlCity, objAddress.GetCityByProvince(sltValue), "CityName", "CityId", "--选择市--");
        }
    
        protected void DdlCity_SelectedIndexChanged(object sender, EventArgs e)
        { 
             string sltValue = this.DdlCity.SelectedItem.Value;
             if (string.IsNullOrEmpty(sltValue))
             {
                 sltValue = "0";
             }
    
            objLcu.DropDownListParse(this.DdlDistrict, objAddress.GetDistrictByCity(sltValue), "DistrictName", "DistrictId", "--选择县或区--");
        }
    }

    转载自http://www.cnblogs.com/insus/archive/2011/07/04/2097059.html

  • 相关阅读:
    project和task
    Gradle的安装
    Spring 集成 RMI
    RMI远程调用
    安装、启动与基本配置
    删除
    文件的分隔与合并
    my27_OGG MySQL To MySQL错误汇总
    1.5 GO json转Map
    1.4 Go语言-switch语句(转)
  • 原文地址:https://www.cnblogs.com/AaronBear/p/5915684.html
Copyright © 2011-2022 走看看