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

推荐订阅源

云风的 BLOG
云风的 BLOG
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Vulnerabilities – Threatpost
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Proofpoint News Feed
G
GRAHAM CLULEY
P
Privacy International News Feed
The Hacker News
The Hacker News
Forbes - Security
Forbes - Security
U
Unit 42
N
News and Events Feed by Topic
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cyber Attacks, Cyber Crime and Cyber Security
C
Cisco Blogs
A
About on SuperTechFans
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
D
Docker
I
Intezer
Spread Privacy
Spread Privacy
The Last Watchdog
The Last Watchdog
V2EX - 技术
V2EX - 技术
S
Security @ Cisco Blogs
F
Full Disclosure
S
Secure Thoughts
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
W
WeLiveSecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Project Zero
Project Zero
Recorded Future
Recorded Future
Cyberwarzone
Cyberwarzone
S
Security Affairs
AWS News Blog
AWS News Blog
H
Help Net Security
The GitHub Blog
The GitHub Blog
Hacker News: Ask HN
Hacker News: Ask HN
Vercel News
Vercel News
P
Proofpoint News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Register - Security
The Register - Security
S
Schneier on Security
F
Fortinet All Blogs
C
CERT Recently Published Vulnerability Notes
L
LINUX DO - 最新话题
T
Tor Project blog
T
The Exploit Database - CXSecurity.com
MongoDB | Blog
MongoDB | Blog
Webroot Blog
Webroot Blog

博客园 - 数字冰块

VS2005 中文版的翻译 - 数字冰块 - 博客园 关于使用 EnumWindows 枚举应用程序窗口的技巧 Requirements Analysis with 'pseud-Formal' Method 微软亚洲研究院夏令营记 软件学院学习体验之三 关于权限模型 .netcpu?!见过了吗? 着手准备开源桌面 Blog 软件 软件学院学习体验之二 VS.NET 服务器资源管理器、Smartphone 模拟器中的程序调试、虚拟网卡、Smartphone 设备上的程序调试及其他。 软件学院学习体验之一 啥叫“Functional Programming ”??? 一个奇怪的问题 什么是高质量的代码? C#中的析构函数 关于.NET异步调用的初步总结 毕业了。。。 两年以后重读了一篇文章,写了点东西。 微软的宣传图片
一定要记住:Page.IsPostBack 不能忘。。。
数字冰块 · 2004-12-25 · via 博客园 - 数字冰块

很长时间不做 asp.net 了,这次一做果然觉得脑子有点钝化。
上周接到个任务,用 asp.net 开发一个运输公司网站的管理界面,页面很简单,主要就是 DataGrid 构成,没什么难度。一步一步做下来,结果却出乎意料,在 DataGrid 上用“编辑”“更新”之类的东西,结果却是把内容清空。由于交付日期比较紧,顿时有点慌。。。
查看代码,又做了一些调试,发觉在类似如下代码的地方,虽然能够取得 DataGrid 上的控件饮用,但是读到的 tb.Text 却是一个空字符串。

TextBox tb = (TextBox)(e.Item.FindControl("txtCN"));

经历的 n(n>=2) 小时的痛苦而又漫长的思考、查阅资料和回想我过去以及被项目负责人的催促下,终于。。。我简直快吐血的通过键盘敲下了

if(!IsPostBack)
{
    
this.dataGrid.DataBind();
}

而我本来的代码里没有判断 IsPostBack ,于是每回发一次页面都会执行一次数据邦定,也难怪读不到数据。。。
大意了啊。。。。。这种小地方不能疏忽啊。。。记一笔先。