遍历repeater里控件的值

     foreach (RepeaterItem item in this.Rpt_Show.Items)
        {
            Label Lbl_HotelName = item.FindControl("Lbl_HotelName") as Label;
            if (Lbl_HotelName != null)
            {
                string str_HotelName = Lbl_HotelName.Text.Trim();
                if (str_HotelName == data.Trim())
                {
                    WinCommon.MessageBox.Show(this.Page, "当前酒店已经添加过");
                    return true;
                }
            }

        }

你可能感兴趣的:(String,null)