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

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
Help Net Security
Help Net Security
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
LINUX DO - 热门话题
Security Latest
Security Latest
A
Arctic Wolf
G
GRAHAM CLULEY
月光博客
月光博客
S
Securelist
D
Docker
J
Java Code Geeks
T
Troy Hunt's Blog
T
Tenable Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 最新话题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
aimingoo的专栏
aimingoo的专栏
博客园 - 【当耐特】
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Forbes - Security
Forbes - Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
B
Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
S
Secure Thoughts
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Check Point Blog
云风的 BLOG
云风的 BLOG
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Blog of Author Tim Ferriss
L
Lohrmann on Cybersecurity
F
Full Disclosure
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed

博客园 - 中国土匪

MSSql Datetime转换成char 的样式汇总 OpenSocial容器开发,资料备注 列出数据库中有数据的表的全部数据 比较两个数据库之间差异的存储过程 关于Web Application中的类无法在页面中引用的问题 图形字符名称表(备查) 决心--重新拾起技术! BitComet的IE插件BitCommet Helper可能给系统造成错误的巨大Bug!!!求解决方案 Page事件发生的先后顺序 操作IIS过程中碰到的问题总结 在 ASP.NET 中使用计时器(Timer) (转载) 当了3个礼拜老师感想 给CheckboxList分页 在.net1.1中发送邮件的几种办法 常用正则表达式总结 datalist分页方式汇总(更新了一种方法) membership.findusersbyname模糊匹配的写法 用BitComet的奇怪问题 装了红帽子9了
关于ItemCommand事件 (转自混沌居)
中国土匪 · 2006-07-19 · via 博客园 - 中国土匪

在一次课上,讲解ItemCommand事件和DeleteCommand事件的时候,学生问我为什么每次点了CommandName为“delete”的按钮的时候ItemCommand事件也被触发了呢?因为我平时写程序的时候没注意这个问题,一下子还真把我难住了! 回办公室后反复做了实验(通过打开页面的Trace跟踪,在相应的事件里用Trace.Warn()方法输出),最后得出结论:

1、ItemCommand事件是DataList控件产生的默认事件,任何DataList控件中CommandName为delete/cancel/update/edit的按钮被点击后,首先触发的是ItemCommand事件,然后才是相应的事件。

2、但是当DataList控件中存在一个普通按钮,点击后触发ItemCommand事件,假设执行功能为选择当前项,此时如果点击了CommandName为edit的按钮,将当前项显示为编辑状态。这个时候并没有出现当前行既被选中又被编辑的情形,这和以上的结论(先触发ItemCommand事件)好象相违背。事实上这并不矛盾,因为DataList控件中的项同一时刻只能显示一个模板,所以执行过程应该是这样的。点击了CommandName为edit的按钮后首先触发了ItemCommand事件,将当前的项显示为SelectedItemTemplate模板,然后再触发EditCommand事件,将当前的项显示为EditItemTemplate模板,覆盖了前面已经显示的SelectedItemTemplate模板,只不过因为速度太快,肉眼看不出这个过程而已!