婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > 如何取得Repeater控件選擇的項目及注意事項

如何取得Repeater控件選擇的項目及注意事項

熱門標(biāo)簽:南陽外呼系統(tǒng)定制化 同安公安400電話怎么申請流程 蘋果手機(jī)凱立德地圖標(biāo)注 預(yù)測式外呼系統(tǒng)使用說明 百度ai地圖標(biāo)注 合肥電銷外呼系統(tǒng)哪家公司做的好 玉林市機(jī)器人外呼系統(tǒng)哪家好 電話機(jī)器人軟件銷售工作 申請400電話手續(xù)
Repeater控件,每個item前有一個CheckBox,把選擇的item列顯出來。

這個演法中,可以看到選擇之后,該行highlight,此功能可以參考這個鏈接:https://www.jb51.net/article/33455.htm
下面是Repeater控件Html,有兩個地方需要注意的,就是CheckBox與Label,這個Label是隨你需要獲取的內(nèi)容而變化喔。如你想獲取Nickname,那你需要把綁定的的內(nèi)容放在Label上。
Repeater CheckBox
復(fù)制代碼 代碼如下:

asp:Repeater ID="RepeaterEmailList" runat="server">
HeaderTemplate>
table border="1" cellpadding="1" cellspacing="0" width="96.5%">
tr>
td>
nbsp;
/td>
td>
Nickname
/td>
td>
Email
/td>
/tr>
/HeaderTemplate>
ItemTemplate>
tr style="height:10px; line-height:10px;">
td>
!--下面這個CheckBox的ID,注意喔,因為后臺需要用到它-->
asp:CheckBox ID="CheckBox1" runat="server" />
/td>
td>
%# Eval("nickname")%>
/td>
td>
!--下面這個Label的ID,注意喔,因為后臺需要用到它-->
asp:Label ID="Label1" runat="server" Text=' %# Eval("mail")%>'>/asp:Label>
/td>
/tr>
/ItemTemplate>
FooterTemplate>
/table>
/FooterTemplate>
/asp:Repeater>

下面Insus.NET將會寫一個方法,也許你的專案不止一個地方使用到,在需要的地方直接調(diào)用即可。
GetCheckBoxSelectedValue
復(fù)制代碼 代碼如下:

private string GetCheckBoxSelectedValue(Repeater repeater, string checkBoxId,string labelId)
{
string tempValue = string.Empty;
foreach (RepeaterItem item in repeater.Items)
{
if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
{
if (item.FindControl(checkBoxId) != null item.FindControl(labelId) != null)
{
CheckBox cb = (CheckBox)item.FindControl(checkBoxId);
Label lbl = (Label)item.FindControl(labelId);
if (cb.Checked)
{
tempValue = tempValue + ";" + lbl.Text;
}
}
}
}
if (tempValue.Length > 0)
{
tempValue = tempValue.Substring(2);
}
return tempValue;
}
您可能感興趣的文章:
  • asp.net使用Repeater控件中的全選進(jìn)行批量操作實(shí)例
  • ASP.NET中repeater控件用法實(shí)例
  • 在Repeater控件中通過Eval的方式綁定Style樣式代碼
  • Repeater控件與PagedDataSource結(jié)合實(shí)現(xiàn)分頁功能
  • Repeater控件實(shí)現(xiàn)編輯、更新、刪除等操作示例代碼
  • 給Repeater控件里添加序號的5種才常見方法介紹
  • Repeater控件綁定的三種方式
  • Repeater控件動態(tài)變更列(Header,Item和Foot)信息實(shí)現(xiàn)思路
  • Repeater控件分別綁定數(shù)組和ArrayList實(shí)現(xiàn)思路
  • Repeater控件數(shù)據(jù)導(dǎo)出Excel(附演示動畫)
  • 淺析Repeater控件的使用 (原樣導(dǎo)出和動態(tài)顯示/隱藏Repeater中的列)

標(biāo)簽:南昌 南京 嘉興 淄博 臺州 揚(yáng)州 海南 南京

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《如何取得Repeater控件選擇的項目及注意事項》,本文關(guān)鍵詞  如何,取得,Repeater,控件,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《如何取得Repeater控件選擇的項目及注意事項》相關(guān)的同類信息!
  • 本頁收集關(guān)于如何取得Repeater控件選擇的項目及注意事項的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 阿拉善右旗| 东山县| 澎湖县| 苍溪县| 西藏| 松江区| 五河县| 泗洪县| 南阳市| 卫辉市| 永清县| 吴旗县| 沛县| 麻阳| 鄂伦春自治旗| 逊克县| 翁牛特旗| 枣庄市| 鄂托克旗| 闻喜县| 罗山县| 科技| 康乐县| 苗栗县| 黄陵县| 西林县| 调兵山市| 东乡族自治县| 湘阴县| 静乐县| 墨玉县| 铁力市| 商水县| 白朗县| 宜兴市| 左权县| 合水县| 灵台县| 荃湾区| 拜泉县| 拉孜县|