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

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - 不做懒人

一个用户登录验证的类 用C#实现C/S模式下软件自动在线升级[转载] 实现.NET应用程序的自动更新[转载] 高效 Ini文件访问类(C#编写,用于Windows Mobile) C#实现“新华网头条的图片新闻” 终于得空,写两句了...... CSS+DIV技巧两则(居中,高度自适应) - 不做懒人 - 博客园 正则表达式替换字符串的一个技巧 --- 可用于关键词变红色 - 不做懒人 下载:Visual Studio 2008 SDK VS2008——软件开发更智能 08年了,准备写点东西了~~ 想设计一个简单的RSS在线阅读程序,欢迎大伙提供意见 [转载]在SQL SERVER如何添加数据用户 大量并发访问xml和数据库的效率问题 字符串数组的一些处理方法总结 [转载]知识不一定会带来金钱,挣钱靠的是能力 [转载]2006年优秀网页UI设计风格剖析 [转载]网页设计技巧系列之文本排版 [转载]网页布局的四种基本型与十二种混合型
Asp.net中下拉框绑定值的怪现象。
不做懒人 · 2007-07-19 · via 博客园 - 不做懒人

页面有3DropDownList控件,绑定的值都是110,刚开始使用的方法是:

ListItem li = null;

           for(int i=1; i <= 10; i++)

           {

              li = new ListItem(i.ToString(), i.ToString());

              this.dlHousetype1.Items.Add(li);

this.dlHousetype2.Items.Add(li);

               this.dlHousetype3.Items.Add(li);

           }

绑定是没有错误,可是在绑定之后,再对三个DropDownList赋值的时候就出错了,选择项根本就不是赋值的那一项。

后来,改为下面的方法实现,竟然没有错误了,不过还不知道是啥原因。

ListItem li = null;

           for(int i=1; i <= 10; i++)

           {

              li = new ListItem(i.ToString(), i.ToString());

              this.dlHousetype1.Items.Add(li);

           }

           for(int i=1; i <= 10; i++)

           {

              li = new ListItem(i.ToString(), i.ToString());

              this.dlHousetype2.Items.Add(li);

           }

           for(int i=1; i <= 10; i++)

           {

              li = new ListItem(i.ToString(), i.ToString());

              this.dlHousetype3.Items.Add(li);

           }