惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
G
Google Developers Blog
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
爱范儿
爱范儿
B
Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
GbyAI
GbyAI
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
博客园_首页
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

博客园 - 风语战士

asp.net 命名规范 CSS 色彩值... 请问 CType和DirectCast函数有何区别 soundex RadMenu菜单的父节指定image - 风语战士 - 博客园 从数据库中存取二进制数据并显示 - 风语战士 - 博客园 vs2005 web.config大全 javascript中showModalDialog和showModelessDialog的使用 设为主页 - 风语战士 - 博客园 CSS样式表 截取字付串 表达是做为参数验证用 DataList翻页 .net安全防止写不规范字付 引用一个falsh使它显示出来 弹出另一页面 (转)VS2005(c#)项目调试问题解决方案集锦 常用正则表达式 在ASP.NET中使用Session常见问题集锦
删除成功后.添加前.可判断
风语战士 · 2007-12-19 · via 博客园 - 风语战士

删除成功后.添加前.可判断


DataGrid1_DeleteCommand 写在这里
if(this.DataGrid1.PageCount==1)
    {
     DataGrid1.CurrentPageIndex=0;
    }
    else if(this.DataGrid1.Items.Count%25==1)
    {
    DataGrid1.CurrentPageIndex--;
    }

25 为变量,每一页的条数.
PageCount 总页数
CurrentPageIndex 显示当前页的索引
DataGrid1.Items.Count 获取总条数
DataGrid1_ItemDataBound 写在这里 在删除前判断是否删除
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem)
   {
       LinkButton link=(LinkButton)e.Item.FindControl("LinkButton1");
    link.Attributes.Add("onclick","return confirm('您是否要删除此条记录!!!');");
             }
FindControl 获取引用控件的ID
LinkButton 变量,也可以是Button Button2.Attributes.Add("onclick","return confirm('确定要修改您信息吗???');");

posted on 2007-12-19 11:10  风语战士  阅读(172)  评论()    收藏  举报