调用:
SetDropDownList(RoomNum, 1, 10, 0);
/// <summary>
/// 设置DropDownList下拉列表的内容
/// </summary>
public static void SetDropDownList(DropDownList xDropDownList,int xMin,int xMax,int xInt)
{
xDropDownList.Items.Clear();
for(int i=xMin;i<=xMax;i++)
{
ListItem myItem=new ListItem(i.ToString(),i.ToString());
xDropDownList.Items.Add(myItem);
}
xDropDownList.SelectedIndex=xInt;
}