首页
VS Code教程
(current)
VS Code插件
(current)
VS Code打造IDE
(current)
VScode更新日志
(current)
关于
ASP.NET repeater添加序号列的方法
437
人浏览 /
0
人评论
在项目开发过程中,会经常遇到ASP.NET repeater控件添加序号列,有些新手可能还不会,网上搜集整理了一些,需要的朋友可以参考下
ASP.NET repeater添加序号列的方法
1、
2、
3、在中添加
function show()
{
var bj = document.all.tags("LABEL");
for (i=0;i
{
document.all["dd"][i].innerHTML=i+1;
}
}
4、后台实现方法
:
在.aspx里添加
在.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);
}
}
根据条件添加html
<%#Container.ItemIndex == 8 ? "
" : ""%>
您可能感兴趣的文章:
asp.net Repeater取得CheckBox选中的某行某个值的c#写法
asp.net repeater手写分页实例代码
asp.net Repeater之非常好的数据分页
asp.net中让Repeater和GridView支持DataPager分页
asp.net Repeater 数据绑定的具体实现(图文详解)
asp.net 遍历repeater中的控件的几种方式
asp.net下Repeater使用 AspNetPager分页控件
asp.net repeater实现批量删除
asp.net Repeater控件的说明及详细介绍及使用方法
asp.net Repeater 数据绑定代码
JQuery实现Repeater无刷新批量删除(附后台asp.net源码)
决定何时使用 DataGrid、DataList 或 Repeater(ASP.NET 技术文章)
ASP.NET笔记之 Repeater的使用
asp.net DataList与Repeater用法区别
详解ASP.NET数据绑定操作中Repeater控件的用法
相关文章
如何有效避免设计作品“空”?
高点击率钻展,设计环节…
无敌配色技巧(一)
留言
全部评论
晴天下起了小雨
2017-10-01 18:00
很喜欢,果断关注了
回复
wjmyly7336064
2017-10-01 18:00
相当实用,赞美了
橘大佬
2017-10-01 18:00
就是有些细节再到位点就好了…
回复
微信公众号
关注微信公众号获取更多VSCode编程信息,定时发布干货文章
最新文章
What's the make money?
MySQL 9.0 的新增功能
Apple 在 iOS 17 中使用 Swift 和 SwiftUI
编写更多“无用”软件
windows 修改环境变量后在 vscode 的终端不生效的两种解决方法
整理列出PHP各个版本5.2至8.0、8.1的特性以及区别
unicode 表情对照表
Stable Diffusion(AI绘画)Lora模型BRA V4发布:AI生成东亚人照片的生态可能因此改变
热门标签
VSCode
python
php
插件
防火墙
nodejs
远程开发
linux
virtualenv
flutter
安卓
苹果
图标主题
mysql
VScode插件
全部评论