内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

如何在repeater里添加序號

2022-06-01    分類: 網(wǎng)站建設(shè)

1、<itemtemplate>
<tr><td>
<%# Container.ItemIndex + 1%>
</td></tr>
</itemtemplate>

2、<itemtemplate>
<tr><td>
<%# this.rpResult.Items.Count + 1%>
</td></tr>
</itemtemplate>

3、

在<form></form>中添加<Label ID='dd' ></Label>

<body nload='show()'>

<Script. Language='JScript'>
      function show()
   {
var bj = document.all.tags('LABEL');
for (i=0;i<obj.length;i++)
{
document.all['dd'][i].innerHTML=i+1;
}
   }
   </script>

4、

后臺實現(xiàn)方法:

在.aspx里添加<asp:Label id='Label1' Runat='server'></asp:Label>

在.cs里添加

** void InitializeComponent()
{   
   this.Repeater1.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.Repeater1_ItemDataBound);
   this.Load += new System.EventHandler(this.Page_Load);

}

** void Repeater1_ItemDataBound(object source, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
   {
    ((Label)e.Item.FindControl('Label1')).Text = Convert.ToString(e.Item.ItemIndex + 1);
   }
}

網(wǎng)頁題目:如何在repeater里添加序號
分享URL:http://www.rwnh.cn/news44/162294.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供用戶體驗、App設(shè)計、定制網(wǎng)站做網(wǎng)站、外貿(mào)網(wǎng)站建設(shè)軟件開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都做網(wǎng)站
邢台市| 七台河市| 娱乐| 莱西市| 磐石市| 泾阳县| 曲周县| 张家港市| 宜川县| 革吉县| 嵊州市| 若羌县| 城市| 牟定县| 恭城| 陆河县| 巴青县| 罗田县| 河北区| 永昌县| 若尔盖县| 松潘县| 耒阳市| 邹城市| 屏边| 咸宁市| 从化市| 西宁市| 黔江区| 古田县| 内江市| 阜新市| 铁岭县| 灵宝市| 巢湖市| 息烽县| 大宁县| 江都市| 互助| 平遥县| 江孜县|