Eric的行政区(省市)下列表控件和标签控件

省市地区选择在各类项目中都可能要用到, 想要联动又刷新, 想只存地区代码又想显示方便, 还想要开发和部署简便...于是我的 DistrictDropDownList和 DistictLabel 应着全国人民的心声面世了 ^o^;; 这两个控件是本人2005年在公司开发一个网游交易网站时顺便做的. 在2006年试用Atlas时发现WebResource的好处后对控件做了改良.

DistrictDropDownList 的特点: 客户端使用JS+XML实现省市联动, 在IE6/5, FF2上测试通过.

DistrictDropDownList 和 DistictLabel 共同特点:
1. 主要属性是Code, Code是个Int32的值, 用于存储全国行政区划编号. 这样用1个变量(字段)就能存储省市(县)区3级别的信息.(区级用得少,所以这个版本没包含)
2. 行政区数据信息以XML格式嵌入在控件DLL中, 数据整理自中国国家统计局行政区划代码2006年12月31日版.
2. 在VS里即拖即用,呵呵


演示地址: http://efplatform.net/demo/webcontrols/districtcontrols.aspx
控件下载地址: http://www.cnblogs.com/Files/ericfine/EFPlatform.WebControls.rar

DistrictControls.aspx:

<% @ Page Language = " C# "   %>

<% @ Register Assembly = " EFPlatform.WebControls "  Namespace = " EFPlatform.WebControls "  TagPrefix = " efp "   %>
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >

< script  runat ="server" >
    protected 
void  Page_Load(object sender, EventArgs e)
    {
        
this .DistrictDropDownList2.Code  =   430100 ;
        
this .DistrictDropDownList3.Code  =   450500 ;
        
this .DistrictDropDownList4.Code  =   210000 ;
    }

    protected 
void  Button1_Click(object sender, EventArgs e)
    {
        
this .DistrictLabel1.Code  =   this .DistrictDropDownList1.Code;
        
this .DistrictLabel2.Code  =   this .DistrictDropDownList2.Code;
        
this .DistrictLabel3.Code  =   this .DistrictDropDownList3.Code;
        
this .DistrictLabel4.Code  =   this .DistrictDropDownList4.Code;
    }
</ script >

< html  xmlns ="http://www.w3.org/1999/xhtml" >
< head  runat ="server" >
    
< title > DistrictDropDownList & DistrictLabel Demo </ title >
</ head >
< body >
    
< form  id ="form1"  runat ="server" >
        
< div >
            
< efp:DistrictDropDownList  ID ="DistrictDropDownList1"  runat ="server"   />
            
< br  />
            
< efp:DistrictDropDownList  ID ="DistrictDropDownList2"  runat ="server"   />
            
< br  />
            
< efp:DistrictDropDownList  ID ="DistrictDropDownList3"  runat ="server"   />
            
< br  />
            
< efp:DistrictDropDownList  ID ="DistrictDropDownList4"  runat ="server"   />
            
< asp:Button  ID ="Button1"  runat ="server"  OnClick ="Button1_Click"  Text ="Button"   />< br  />
            
< br  />
            
< efp:DistrictLabel  ID ="DistrictLabel1"  runat ="server" >
            
</ efp:DistrictLabel >
            
< br  />
            
< efp:DistrictLabel  ID ="DistrictLabel2"  runat ="server" >
            
</ efp:DistrictLabel >
            
< br  />
            
< efp:DistrictLabel  ID ="DistrictLabel3"  runat ="server" >
            
</ efp:DistrictLabel >
            
< br  />
            
< efp:DistrictLabel  ID ="DistrictLabel4"  runat ="server" >
            
</ efp:DistrictLabel >
        
</ div >
    
</ form >
</ body >
</ html >

转载于:https://www.cnblogs.com/ericfine/archive/2007/06/30/801562.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值