主頁 > 知識(shí)庫 > Repeater控件分別綁定數(shù)組和ArrayList實(shí)現(xiàn)思路

Repeater控件分別綁定數(shù)組和ArrayList實(shí)現(xiàn)思路

熱門標(biāo)簽:團(tuán)購網(wǎng)站 服務(wù)器配置 銀行業(yè)務(wù) Linux服務(wù)器 阿里云 電子圍欄 Mysql連接數(shù)設(shè)置 科大訊飛語音識(shí)別系統(tǒng)
前臺(tái)代碼
復(fù)制代碼 代碼如下:

asp:Repeater ID="rptarry" runat="server" >
HeaderTemplate>table>/HeaderTemplate>
ItemTemplate>
tr>td> %# GetDataItem()%> /td>/tr>
/ItemTemplate>
FooterTemplate>/table>/FooterTemplate>
/asp:Repeater>
asp:Repeater ID="rptarryList" runat="server">
HeaderTemplate>table>/HeaderTemplate>
ItemTemplate>
tr>td> %# GetDataItem()%> /td>/tr>
/ItemTemplate>
FooterTemplate>/table>/FooterTemplate>
/asp:Repeater>

后臺(tái)代碼
復(fù)制代碼 代碼如下:

public void bindrptarry()
{
string strs = "li|wen|yuan";
string[] str = strs.Split('|');
rptarry.DataSource =str;
rptarry.DataBind();
}
public void bindrptarryList()
{
string strs = "li|wen|yuan";
string[] str = strs.Split('|');
rptarry.DataSource = arrayList();
rptarry.DataBind();
}
public ArrayList arrayList()
{
ArrayList aL = new ArrayList();
aL.Add("liceshi");
aL.Add("wenceshi");
aL.Add("yuanceshi");
return aL;
}

在后臺(tái)用DataSource綁上數(shù)據(jù)源(數(shù)組或ArrayList)在調(diào)用DataBind()方法,
在前臺(tái)調(diào)用%# GetDataItem()%>。

如果哪里有不正確的地方,歡迎批評(píng)指正,共同進(jìn)步。
您可能感興趣的文章:
  • asp.net使用Repeater控件中的全選進(jìn)行批量操作實(shí)例
  • ASP.NET中repeater控件用法實(shí)例
  • 在Repeater控件中通過Eval的方式綁定Style樣式代碼
  • Repeater控件與PagedDataSource結(jié)合實(shí)現(xiàn)分頁功能
  • Repeater控件實(shí)現(xiàn)編輯、更新、刪除等操作示例代碼
  • 給Repeater控件里添加序號(hào)的5種才常見方法介紹
  • Repeater控件綁定的三種方式
  • Repeater控件動(dòng)態(tài)變更列(Header,Item和Foot)信息實(shí)現(xiàn)思路
  • 如何取得Repeater控件選擇的項(xiàng)目及注意事項(xiàng)
  • Repeater控件數(shù)據(jù)導(dǎo)出Excel(附演示動(dòng)畫)
  • 淺析Repeater控件的使用 (原樣導(dǎo)出和動(dòng)態(tài)顯示/隱藏Repeater中的列)

標(biāo)簽:蚌埠 萍鄉(xiāng) 江蘇 大理 衢州 廣元 棗莊 衡水

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Repeater控件分別綁定數(shù)組和ArrayList實(shí)現(xiàn)思路》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266