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

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

博客园 - 小飞虫

遍历 Session,Cookie,Application JS获取URL参数值 - 小飞虫 - 博客园 PHP时间戳 Mysql 备注数据库脚本 gridview 为CommandArgument绑定行号 .net 3.5 属性简写 有效解决CSS兼容性的技巧 如何避免DropDownList绑定无效值时抛出异常 网上找的JS身份证验证,修复了一个日期验证的bug 几个js的正则表达式验证 通过javascript修改文本框内容后提交 正则表达表手机号码 修改成员管理默认的密码规则 js密码验证 js邮件地址验证脚本 asp.net 上传图片并生成缩略图 .net2.0邮件发送程序 从框架中关闭浏览器的JS脚本 关于web.config的问题
DropDownList绑定枚举类型
小飞虫 · 2010-03-17 · via 博客园 - 小飞虫

public enum emNum
{
  zero
= 0,
  one  
= 1,
  two  
= 2
}

x1.DataSource

=Enum.GetValues(typeof(emNum)); 
x1.DataBind(); 

下面是分别绑带TEXT或VALUE,为了达到更好的效果,使用到了中文变量

public enum 数值
{
  零  
= 0,
  一  
= 1,
  二  
= 2
}
foreach(数值 _x in Enum.GetValues(typeof(数值)))
{
    xl.Items.Add(
new ListItem(_x.ToString(), Convert.ToInt32(_x).ToString()));
}