代码为:
//加入编辑选项,使能在DropDownList中显示数据,于男女
public string[] Title
{
get
{
return new string[4]{"Mr.","Dr.","Ms.","Mrs."};
}
}
//对DropDownList数据源绑定要特殊点,多想想
//Title为上面的组,小写的title为DropDownList中的数据源,这个你看看Html标记中的模板, 多想想这个原理
public int Get(object title) //方法绑定DropDownList数据,在模板中调用这个方法
{
return Array.IndexOf(Title,title.ToString());
}