本帖最后由 Nanjim 于 2010-03-12 13:58:41 编辑

解决方案 »

  1.   

    ddlBreakfast.Items.FindByValue(_T_enCusInfo_RoomType.Breakfast)
    ==>没找到。
      

  2.   

    _T_enCusInfo_RoomType.Breakfast  是否是字符串"不含早"和"含早"页面源文件为:
    <select name="ddlBreakfast" id="ddlBreakfast">
    <option value="不含早">不含早</option>
    <option selected="selected" value="含早">含早</option></select>修改下if (ddlBreakfast.Items.FindByValue(_T_enCusInfo_RoomType.Breakfast) != null)
                {
                    ddlBreakfast.Items.FindByValue(_T_enCusInfo_RoomType.Breakfast).Selected = true;
                }
      

  3.   

    数据是通过DropDownList中读取放入数据库的,然后又读出来的
      

  4.   

    //这里有误,在ddlBreakfast中没有找到值
    ddlBreakfast.Items.FindByValue(_T_enCusInfo_RoomType.Breakfast).Selected = true;
    ddlNetWork.Items.FindByValue(_T_enCusInfo_RoomType.Network).Selected = true;
    //改写为
    if (ddlBreakfast.Items.FindByValue(_T_enCusInfo_RoomType.Breakfast) != null)
    {
        ddlBreakfast.Items.FindByValue(_T_enCusInfo_RoomType.Breakfast).Selected = true;
    }
    if (ddlNetWork.Items.FindByValue(_T_enCusInfo_RoomType.Network) != null)
    {
        ddlNetWork.Items.FindByValue(_T_enCusInfo_RoomType.Network).Selected = true;
    }
      

  5.   

    ddlst.selectindex=ddlst.items.indexof(ddlst.items.findbyvalue[findbytext]("value[text]"));
    这样不知道成不?