我想写一个函数,输入4个dropdownlist,经过一系列操作,再把这4个dropdownlist输出,函数返回值是什么呢?返回值该怎么和原来的4个dropdownlist绑定呢?
public void aaaa(DropDownList DropDownList1, DropDownList DropDownList2, DropDownList DropDownList3, DropDownList DropDownList4)
{
}
public void aaaa(DropDownList DropDownList1, DropDownList DropDownList2, DropDownList DropDownList3, DropDownList DropDownList4)
{
}
输出=response.write()?visible=true?
private void aaa(DropDownList drp)
{
ArrayList arr = new ArrayList();
for (int i = 0; i < drp.Items.Count; i++)
{
arr.Add(drp.Items[i].ToString()+"*");
}
drp.Items.Clear();
for (int i = 0; i < arr.Count; i++)
{
drp.Items.Add(arr[i]);
}
}
{
}
函数返回 List<DropDownList>里面对应的保存各个DropDownList,注意顺序哦
{
}
或使用List<T>保存实现返回
或Dictionary
用得着ref、out?
dropdownlist本身就是引用传值,在函数里边对dropdownlist的任何改动,出来函数外边
效果还是存在的!楼主试试函数吧! 返回void就行!