继承DropDownList
begin
public class MyDropDown : System.Web.UI.WebControls.DropDownList
{
#region 改变样式
//protected override void Render(System.Web.UI.HtmlTextWriter writer)
//{
// writer.Write("aaaaaaaaaaaa");
// this.Attributes["width"] = "100";
//}
//protected override void LoadViewState(object savedState)
//{
// object[] dlls = (Object[])savedState;
// base.LoadViewState(dlls[0]);
// System.Collections.ArrayList list = (System.Collections.ArrayList)dlls[1];
// for (int i = 0; i < list.Count; i++)
// {
// System.Collections.Hashtable hash = (System.Collections.Hashtable)list[i];
// foreach (object key in hash.Keys)
// {
// Items[i].Attributes.Add(key.ToString(), hash[key].ToString());
// }
// }
//}
//protected override object SaveViewState()
//{
// object[] attr = new object[2];
// attr[0] = base.SaveViewState();
// System.Collections.ArrayList list = new System.Collections.ArrayList();
// attr[1] = list;
// foreach (ListItem item in this.Items)
// {
// System.Collections.Hashtable hash = new System.Collections.Hashtable();
// fore