二级DropDownList控件源码
将源码放于此,不过感觉并不是很满意。
有一个小问题,就是获取小类的值,因为控件中加入了一个功能,就是如果在初始时带入小类的值时,控件会自动将小类相应的选项选中,并带动大类的选项,这样就一个冲突:获取小类的值与初始小类的值带来的影响。
又开始忙了,再琢磨一下后修改。
源码如下:
有一个小问题,就是获取小类的值,因为控件中加入了一个功能,就是如果在初始时带入小类的值时,控件会自动将小类相应的选项选中,并带动大类的选项,这样就一个冲突:获取小类的值与初始小类的值带来的影响。
又开始忙了,再琢磨一下后修改。
源码如下:
using System.Text;
using System.Globalization;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.UI.Design;
using System;
using System.Drawing.Design;
using System.Drawing;
using System.Data;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections.Specialized;
namespace Flyangel.Component.WebUI
{
/**//// <summary>
/// AutoSelectDropList 的摘要说明。
/// </summary>
[ToolboxData("<{0}:AutoSelectDropList runat=server></{0}:AutoSelectDropList>")]
public class AutoSelectDropList : Control, INamingContainer,IPostBackEventHandler,IPostBackDataHandler
{
DropDownList _childdropdownlist = new DropDownList();
DropDownList _fatherdropdownlist = new DropDownList();
HtmlInputHidden _hideinput = new HtmlInputHidden();
属性#region 属性
数据源设置#region 数据源设置
private DataSet _ds;
[Browsable(false),
Category("数据源设置"),Description("为控件设置数据源,按类别库特点,其类型为DataSet,其中包括两个DataTable,Father表中放置父记录,Child表中放置所有子记录。")]
public DataSet DataSource
{
get {return (DataSet)HttpContext.Current.Cache["AutoSelectDropList"];}
set
{
_ds = value;
if (HttpContext.Current.Cache["AutoSelectDropList"]==null)
{
HttpContext.Current.Cache.Insert("AutoSelectDropList",_ds);
}
}
}
#endregion
所属FORM的ID名称#region 所属FORM的ID名称
private String _formname = "form1";
/**//// <summary>
/// 所属FORM的ID名称
/// </summary>
[Browsable(true),
Description("所属FORM的ID名称,如默认值!"),Category("表单ID设置"),
DefaultValue("form1")]
public String SetFormID
{
set{_formname= value;}
get{return _formname;}
}
#endregion
ChildID设置,用来进行子栏目的选择,并反向控制父栏的选择#region ChildID设置,用来进行子栏目的选择,并反向控制父栏的选择
/**//// <summary>
/// 栏目的选择
/// </summary>
[Browsable(true),
Description("ChildID设置,用来进行子栏目的选择,并反向控制父栏的选择!"),Category("ChildID设置"),
DefaultValue("0")]
private string _setselectchildid = "0";
public string SetSelectedChildID
{
get{return _setselectchildid;}
set{ _setselectchildid = value; }
}
[Browsable(false),
Description("FatherID设置,用来进行父栏目的选择,并反向控制父栏的选择!"),Category("FatherID设置"),
DefaultValue("0")]
private string _setselectfatherid = "0";
private String SetSelectedFatherID
{
get {return _setselectfatherid;}
set {_setselectfatherid = value; }
}
#endregion
数据字段设置#region 数据字段设置
private String _fatherfieldname = "ClassName";
/**//// <summary>
/// 父类名称
/// </summary>
[Browsable(true),
Description("父类名称在数据表中的相应的记录名称字段,如默认值!"),Category("数据字段设置"),
DefaultValue("ClassName")]
public String SetFatherFieldName
{
set{_fatherfieldname= value;}
get{return _fatherfieldname;}
}
private String _fatherfieldid = "ClassID";
/**//// <summary>
/// 父类ID
/// </summary>
[Browsable(true),
Description("父类名称在数据表中的相应的记录ID字段,如默认值!"),Category("数据字段设置"),
DefaultValue("ClassID")]
public String SetFatherFieldID
{
set{_fatherfieldid= value;}
get{return _fatherfieldid;}
}
private String _childfieldname = "ClassName";
/**//// <summary>
/// 子类名称
/// </summary>
[Browsable(true),
Description("子类名称在数据表中的相应的记录名称字段,如默认值!"),Category("数据字段设置"),
DefaultValue("name")]
public String SetChildFieldName
{
set{_childfieldname= value;}
get{return _childfieldname;}
}
private String _childfieldid = "ClassID";
/**//// <summary>
/// 子类ID
/// </summary>
[Browsable(true),
Description("子类名称在数据表中的相应的记录ID字段,如默认值!"),Category("数据字段设置"),
DefaultValue("ClassID")]
public String SetChildFieldID
{
set{_childfieldid= value;}
get{return _childfieldid;}
}
private String _parentid = "ParentID";
/**//// <summary>
/// 父类ID
/// </summary>
[Browsable(true),
Description("子类名称在数据表中的相应的记录ID字段,如默认值!"),Category("数据字段设置"),
DefaultValue("ParentID")]
public String SetParentID
{
set{_parentid= value;}
get{return _parentid;}
}
#endregion
#region
public string GetFatherSelectedValue
{
get {return _fatherdropdownlist.SelectedValue;}
}
public string GetChildSelectedValue
{
get {return _hideinput.Value;}
}
#endregion
#endregion
public void RenderAtDesignTime()
{
if (!Page.IsPostBack)
{
CreateChildControls();
}
}
protected override void CreateChildControls()
{
Controls.Clear();
_hideinput.ID = "SCvalue";
_hideinput.Value = "0";
Controls.Add(_hideinput);
_fatherdropdownlist.ID = "fatherid";
_fatherdropdownlist.Attributes.Add("onChange","changelocation(document." + _formname + "." + this.ClientID + "_fatherid.options[document." + _formname + "." + this.ClientID + "_fatherid.selectedIndex].value)");
ListItem _newli = new ListItem();
_newli.Text = "一级栏目";
_newli.Value = "0";
_fatherdropdownlist.Items.Add(_newli);
if (SetSelectedChildID != "0")
{
GetFatherIDFormChildID();
}
int _tempfatheridstr = 0;
for(int i = 0; i<(DataSource.Tables[0].Rows.Count);i++)
{
ListItem _newlii = new ListItem();
_newlii.Value = DataSource.Tables[0].Rows[i][_fatherfieldid].ToString();
_newlii.Text = DataSource.Tables[0].Rows[i][_fatherfieldname].ToString();
_fatherdropdownlist.Items.Add(_newlii);
if (SetSelectedFatherID == DataSource.Tables[0].Rows[i][_fatherfieldid].ToString())
{
_tempfatheridstr = i+1;
}
}
Controls.Add(_fatherdropdownlist);
_fatherdropdownlist.SelectedIndex = _tempfatheridstr;
_childdropdownlist.ID = "childid";
_childdropdownlist.Attributes.Add("onChange","changechild(document." + _formname + "." + this.ClientID + "_childid.options[document." + _formname + "." + this.ClientID + "_childid.selectedIndex].value)");
int _tempchildidstr = 0;
if (SetSelectedChildID != "0")
{
DataView _temdv = new DataView(DataSource.Tables[1]);
string _filterstr = _parentid + " = " + SetSelectedFatherID;
_temdv.RowFilter = _filterstr;
for (int jj=0;jj<_temdv.Count;jj++)
{
ListItem _newlijai = new ListItem();
_newlijai.Value = _temdv[jj][_childfieldid].ToString();
_newlijai.Text = _temdv[jj][_childfieldname].ToString();
_childdropdownlist.Items.Add(_newlijai);
if (SetSelectedChildID == _temdv[jj][_childfieldid].ToString())
{
_tempchildidstr = jj;
}
}
}
else
{
ListItem _newliji = new ListItem();
_newliji.Text = "二级栏目";
_newliji.Value = "0";
_childdropdownlist.Items.Add(_newliji);
}
Controls.Add(_childdropdownlist);
_childdropdownlist.SelectedIndex = _tempchildidstr;
AddClientScript();
}
private void GetFatherIDFormChildID()
{
for(int j = 0; j<(DataSource.Tables[1].Rows.Count);j++)
{
if (SetSelectedChildID == DataSource.Tables[1].Rows[j][_childfieldid].ToString())
{
SetSelectedFatherID = DataSource.Tables[1].Rows[j][_parentid].ToString();
}
}
}
IPostBackEventHandler Implementation#region IPostBackEventHandler Implementation
/**//// <summary>
/// 实现<see cref="IPostBackEventHandler"/> 接口,使控件能够处理将窗体发送到服务器时引发的事件。
/// </summary>
/// <param name="args"></param>
public void RaisePostBackEvent(string args)
{
}
#endregion
IPostBackDataHandler Implementation#region IPostBackDataHandler Implementation
/**//// <summary>
/// 实现 <see cref="IPostBackDataHandler"/> 接口,为服务器控件处理回发数据。
/// </summary>
/// <param name="pkey">控件的主要标识符。</param>
/// <param name="pcol">所有传入名称值的集合。</param>
/// <returns></returns>
public virtual bool LoadPostData(string pkey,NameValueCollection pcol)
{
return false;
}
/**//// <summary>
/// 实现 <see cref="IPostBackDataHandler"/> 接口,用信号要求服务器控件对象通知 ASP.NET 应用程序该控件的状态已更改。
/// </summary>
public virtual void RaisePostDataChangedEvent()
{
OnPageChanged(EventArgs.Empty);
}
#endregion
PageChanged Event#region PageChanged Event
public event EventHandler PageChanged;
#endregion
OnPageChanged Method#region OnPageChanged Method
/**//// <summary>
/// 引发 <see cref="PageChanged"/> 事件。这使您可以为事件提供自定义处理程序。
/// </summary>
/// <param name="e">一个 <see cref="PageChangedEventArgs"/>,它包含事件数据。</param>
protected virtual void OnPageChanged(EventArgs e)
{
if(this.PageChanged!=null)
{
PageChanged(this,e);
}
}
#endregion
private void AddClientScript()
{
if(!Page.IsClientScriptBlockRegistered("clientScript"))
{
StringBuilder stringScript = new StringBuilder() ;
stringScript.Append("<!-- 设计:flash1313699@hotmail.com QQ:3337002 --> ");
stringScript.Append("<script language="javascript"> ");
stringScript.Append("var onecount; ");
stringScript.Append("subcat = new Array(); ");
int _temi = DataSource.Tables[0].Rows.Count;
for(int i = 0; i<_temi;i++)
{
stringScript.Append("subcat[" + i + "] = new Array("二级栏目","" + DataSource.Tables[0].Rows[i][_fatherfieldid].ToString() + "","0"); ");
}
int _temj = DataSource.Tables[1].Rows.Count;
for(int j = 0; j<_temj;j++)
{
stringScript.Append("subcat[" + (_temi + j) + "] = new Array("" + DataSource.Tables[1].Rows[j][_childfieldname].ToString() + "","" + DataSource.Tables[1].Rows[j][_parentid].ToString() + "","" + DataSource.Tables[1].Rows[j][_childfieldid].ToString() + ""); ");
}
stringScript.Append("subcat[" + (_temj + _temi) + "] = new Array("二级栏目","0","0"); ");
stringScript.Append("onecount=" + (_temj + _temi + 1) + " ");
stringScript.Append(" ");
stringScript.Append("function changelocation(locationid) ");
stringScript.Append("{ ");
stringScript.Append(" document." + _formname + "." + this.ClientID + "_SCvalue.value = '0'; ");
stringScript.Append(" document." + _formname + "." + this.ClientID + "_childid.length = 0; ");
stringScript.Append(" var locationid=locationid; ");
stringScript.Append(" var i; ");
stringScript.Append(" for (i=0;i < onecount; i++) ");
stringScript.Append(" { ");
stringScript.Append(" if (subcat[i][1] == locationid) ");
stringScript.Append(" { ");
stringScript.Append(" document." + _formname + "." + this.ClientID + "_childid.options[document." + _formname + "." + this.ClientID + "_childid.length] = new Option(subcat[i][0], subcat[i][2]); ");
stringScript.Append(" } ");
stringScript.Append(" } ");
stringScript.Append("} ");
stringScript.Append("function changechild(str) ");
stringScript.Append("{ ");
stringScript.Append(" document." + _formname + "." + this.ClientID + "_SCvalue.value = str; ");
stringScript.Append("} ");
stringScript.Append("</SCRIPT> ");
stringScript.Append("<!-- 设计:flash1313699@hotmail.com QQ:3337002 --> ");
Page.RegisterClientScriptBlock("clientScript", stringScript.ToString());
}
}
}
}
using System.Globalization;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.UI.Design;
using System;
using System.Drawing.Design;
using System.Drawing;
using System.Data;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections.Specialized;
namespace Flyangel.Component.WebUI
{
/**//// <summary>
/// AutoSelectDropList 的摘要说明。
/// </summary>
[ToolboxData("<{0}:AutoSelectDropList runat=server></{0}:AutoSelectDropList>")]
public class AutoSelectDropList : Control, INamingContainer,IPostBackEventHandler,IPostBackDataHandler
{
DropDownList _childdropdownlist = new DropDownList();
DropDownList _fatherdropdownlist = new DropDownList();
HtmlInputHidden _hideinput = new HtmlInputHidden();
属性#region 属性
数据源设置#region 数据源设置
private DataSet _ds;
[Browsable(false),
Category("数据源设置"),Description("为控件设置数据源,按类别库特点,其类型为DataSet,其中包括两个DataTable,Father表中放置父记录,Child表中放置所有子记录。")]
public DataSet DataSource
{
get {return (DataSet)HttpContext.Current.Cache["AutoSelectDropList"];}
set
{
_ds = value;
if (HttpContext.Current.Cache["AutoSelectDropList"]==null)
{
HttpContext.Current.Cache.Insert("AutoSelectDropList",_ds);
}
}
}
#endregion
所属FORM的ID名称#region 所属FORM的ID名称
private String _formname = "form1";
/**//// <summary>
/// 所属FORM的ID名称
/// </summary>
[Browsable(true),
Description("所属FORM的ID名称,如默认值!"),Category("表单ID设置"),
DefaultValue("form1")]
public String SetFormID
{
set{_formname= value;}
get{return _formname;}
}
#endregion
ChildID设置,用来进行子栏目的选择,并反向控制父栏的选择#region ChildID设置,用来进行子栏目的选择,并反向控制父栏的选择
/**//// <summary>
/// 栏目的选择
/// </summary>
[Browsable(true),
Description("ChildID设置,用来进行子栏目的选择,并反向控制父栏的选择!"),Category("ChildID设置"),
DefaultValue("0")]
private string _setselectchildid = "0";
public string SetSelectedChildID
{
get{return _setselectchildid;}
set{ _setselectchildid = value; }
}
[Browsable(false),
Description("FatherID设置,用来进行父栏目的选择,并反向控制父栏的选择!"),Category("FatherID设置"),
DefaultValue("0")]
private string _setselectfatherid = "0";
private String SetSelectedFatherID
{
get {return _setselectfatherid;}
set {_setselectfatherid = value; }
}
#endregion
数据字段设置#region 数据字段设置
private String _fatherfieldname = "ClassName";
/**//// <summary>
/// 父类名称
/// </summary>
[Browsable(true),
Description("父类名称在数据表中的相应的记录名称字段,如默认值!"),Category("数据字段设置"),
DefaultValue("ClassName")]
public String SetFatherFieldName
{
set{_fatherfieldname= value;}
get{return _fatherfieldname;}
}
private String _fatherfieldid = "ClassID";
/**//// <summary>
/// 父类ID
/// </summary>
[Browsable(true),
Description("父类名称在数据表中的相应的记录ID字段,如默认值!"),Category("数据字段设置"),
DefaultValue("ClassID")]
public String SetFatherFieldID
{
set{_fatherfieldid= value;}
get{return _fatherfieldid;}
}
private String _childfieldname = "ClassName";
/**//// <summary>
/// 子类名称
/// </summary>
[Browsable(true),
Description("子类名称在数据表中的相应的记录名称字段,如默认值!"),Category("数据字段设置"),
DefaultValue("name")]
public String SetChildFieldName
{
set{_childfieldname= value;}
get{return _childfieldname;}
}
private String _childfieldid = "ClassID";
/**//// <summary>
/// 子类ID
/// </summary>
[Browsable(true),
Description("子类名称在数据表中的相应的记录ID字段,如默认值!"),Category("数据字段设置"),
DefaultValue("ClassID")]
public String SetChildFieldID
{
set{_childfieldid= value;}
get{return _childfieldid;}
}
private String _parentid = "ParentID";
/**//// <summary>
/// 父类ID
/// </summary>
[Browsable(true),
Description("子类名称在数据表中的相应的记录ID字段,如默认值!"),Category("数据字段设置"),
DefaultValue("ParentID")]
public String SetParentID
{
set{_parentid= value;}
get{return _parentid;}
}
#endregion
#region
public string GetFatherSelectedValue
{
get {return _fatherdropdownlist.SelectedValue;}
}
public string GetChildSelectedValue
{
get {return _hideinput.Value;}
}
#endregion
#endregion
public void RenderAtDesignTime()
{
if (!Page.IsPostBack)
{
CreateChildControls();
}
}
protected override void CreateChildControls()
{
Controls.Clear();
_hideinput.ID = "SCvalue";
_hideinput.Value = "0";
Controls.Add(_hideinput);
_fatherdropdownlist.ID = "fatherid";
_fatherdropdownlist.Attributes.Add("onChange","changelocation(document." + _formname + "." + this.ClientID + "_fatherid.options[document." + _formname + "." + this.ClientID + "_fatherid.selectedIndex].value)");
ListItem _newli = new ListItem();
_newli.Text = "一级栏目";
_newli.Value = "0";
_fatherdropdownlist.Items.Add(_newli);
if (SetSelectedChildID != "0")
{
GetFatherIDFormChildID();
}
int _tempfatheridstr = 0;
for(int i = 0; i<(DataSource.Tables[0].Rows.Count);i++)
{
ListItem _newlii = new ListItem();
_newlii.Value = DataSource.Tables[0].Rows[i][_fatherfieldid].ToString();
_newlii.Text = DataSource.Tables[0].Rows[i][_fatherfieldname].ToString();
_fatherdropdownlist.Items.Add(_newlii);
if (SetSelectedFatherID == DataSource.Tables[0].Rows[i][_fatherfieldid].ToString())
{
_tempfatheridstr = i+1;
}
}
Controls.Add(_fatherdropdownlist);
_fatherdropdownlist.SelectedIndex = _tempfatheridstr;
_childdropdownlist.ID = "childid";
_childdropdownlist.Attributes.Add("onChange","changechild(document." + _formname + "." + this.ClientID + "_childid.options[document." + _formname + "." + this.ClientID + "_childid.selectedIndex].value)");
int _tempchildidstr = 0;
if (SetSelectedChildID != "0")
{
DataView _temdv = new DataView(DataSource.Tables[1]);
string _filterstr = _parentid + " = " + SetSelectedFatherID;
_temdv.RowFilter = _filterstr;
for (int jj=0;jj<_temdv.Count;jj++)
{
ListItem _newlijai = new ListItem();
_newlijai.Value = _temdv[jj][_childfieldid].ToString();
_newlijai.Text = _temdv[jj][_childfieldname].ToString();
_childdropdownlist.Items.Add(_newlijai);
if (SetSelectedChildID == _temdv[jj][_childfieldid].ToString())
{
_tempchildidstr = jj;
}
}
}
else
{
ListItem _newliji = new ListItem();
_newliji.Text = "二级栏目";
_newliji.Value = "0";
_childdropdownlist.Items.Add(_newliji);
}
Controls.Add(_childdropdownlist);
_childdropdownlist.SelectedIndex = _tempchildidstr;
AddClientScript();
}
private void GetFatherIDFormChildID()
{
for(int j = 0; j<(DataSource.Tables[1].Rows.Count);j++)
{
if (SetSelectedChildID == DataSource.Tables[1].Rows[j][_childfieldid].ToString())
{
SetSelectedFatherID = DataSource.Tables[1].Rows[j][_parentid].ToString();
}
}
}
IPostBackEventHandler Implementation#region IPostBackEventHandler Implementation
/**//// <summary>
/// 实现<see cref="IPostBackEventHandler"/> 接口,使控件能够处理将窗体发送到服务器时引发的事件。
/// </summary>
/// <param name="args"></param>
public void RaisePostBackEvent(string args)
{
}
#endregion
IPostBackDataHandler Implementation#region IPostBackDataHandler Implementation
/**//// <summary>
/// 实现 <see cref="IPostBackDataHandler"/> 接口,为服务器控件处理回发数据。
/// </summary>
/// <param name="pkey">控件的主要标识符。</param>
/// <param name="pcol">所有传入名称值的集合。</param>
/// <returns></returns>
public virtual bool LoadPostData(string pkey,NameValueCollection pcol)
{
return false;
}
/**//// <summary>
/// 实现 <see cref="IPostBackDataHandler"/> 接口,用信号要求服务器控件对象通知 ASP.NET 应用程序该控件的状态已更改。
/// </summary>
public virtual void RaisePostDataChangedEvent()
{
OnPageChanged(EventArgs.Empty);
}
#endregion
PageChanged Event#region PageChanged Event
public event EventHandler PageChanged;
#endregion
OnPageChanged Method#region OnPageChanged Method
/**//// <summary>
/// 引发 <see cref="PageChanged"/> 事件。这使您可以为事件提供自定义处理程序。
/// </summary>
/// <param name="e">一个 <see cref="PageChangedEventArgs"/>,它包含事件数据。</param>
protected virtual void OnPageChanged(EventArgs e)
{
if(this.PageChanged!=null)
{
PageChanged(this,e);
}
}
#endregion
private void AddClientScript()
{
if(!Page.IsClientScriptBlockRegistered("clientScript"))
{
StringBuilder stringScript = new StringBuilder() ;
stringScript.Append("<!-- 设计:flash1313699@hotmail.com QQ:3337002 --> ");
stringScript.Append("<script language="javascript"> ");
stringScript.Append("var onecount; ");
stringScript.Append("subcat = new Array(); ");
int _temi = DataSource.Tables[0].Rows.Count;
for(int i = 0; i<_temi;i++)
{
stringScript.Append("subcat[" + i + "] = new Array("二级栏目","" + DataSource.Tables[0].Rows[i][_fatherfieldid].ToString() + "","0"); ");
}
int _temj = DataSource.Tables[1].Rows.Count;
for(int j = 0; j<_temj;j++)
{
stringScript.Append("subcat[" + (_temi + j) + "] = new Array("" + DataSource.Tables[1].Rows[j][_childfieldname].ToString() + "","" + DataSource.Tables[1].Rows[j][_parentid].ToString() + "","" + DataSource.Tables[1].Rows[j][_childfieldid].ToString() + ""); ");
}
stringScript.Append("subcat[" + (_temj + _temi) + "] = new Array("二级栏目","0","0"); ");
stringScript.Append("onecount=" + (_temj + _temi + 1) + " ");
stringScript.Append(" ");
stringScript.Append("function changelocation(locationid) ");
stringScript.Append("{ ");
stringScript.Append(" document." + _formname + "." + this.ClientID + "_SCvalue.value = '0'; ");
stringScript.Append(" document." + _formname + "." + this.ClientID + "_childid.length = 0; ");
stringScript.Append(" var locationid=locationid; ");
stringScript.Append(" var i; ");
stringScript.Append(" for (i=0;i < onecount; i++) ");
stringScript.Append(" { ");
stringScript.Append(" if (subcat[i][1] == locationid) ");
stringScript.Append(" { ");
stringScript.Append(" document." + _formname + "." + this.ClientID + "_childid.options[document." + _formname + "." + this.ClientID + "_childid.length] = new Option(subcat[i][0], subcat[i][2]); ");
stringScript.Append(" } ");
stringScript.Append(" } ");
stringScript.Append("} ");
stringScript.Append("function changechild(str) ");
stringScript.Append("{ ");
stringScript.Append(" document." + _formname + "." + this.ClientID + "_SCvalue.value = str; ");
stringScript.Append("} ");
stringScript.Append("</SCRIPT> ");
stringScript.Append("<!-- 设计:flash1313699@hotmail.com QQ:3337002 --> ");
Page.RegisterClientScriptBlock("clientScript", stringScript.ToString());
}
}
}
}
posted on 2004-09-24 00:20 flyangel 阅读(390) 评论(2) 编辑 收藏
评论
不过是C#的。支持一下
用Js是不是更短或者说方便一些
# re: 二级DropDownList控件源码
:),其实WEB控件中很多是无法离开JS的。换句话说,WEB本身是无法离开JS的。其实只是无聊的一种做法。为了让自己方便,而不是去实现一个大而全的万能公式。