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

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Secure Thoughts
Recorded Future
Recorded Future
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
The Blog of Author Tim Ferriss
B
Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Google DeepMind News
Google DeepMind News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
Arctic Wolf
T
The Exploit Database - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
GbyAI
GbyAI
AWS News Blog
AWS News Blog
MongoDB | Blog
MongoDB | Blog
Y
Y Combinator Blog
Google Online Security Blog
Google Online Security Blog
T
Troy Hunt's Blog
I
InfoQ
L
LINUX DO - 热门话题
WordPress大学
WordPress大学
C
Cisco Blogs
G
GRAHAM CLULEY
The Register - Security
The Register - Security
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Schneier on Security
Schneier on Security
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
H
Hacker News: Front Page
小众软件
小众软件
雷峰网
雷峰网
The Hacker News
The Hacker News
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Tor Project blog
博客园 - 聂微东
N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
The GitHub Blog
The GitHub Blog
腾讯CDC
P
Palo Alto Networks Blog
Scott Helme
Scott Helme

博客园 - 小柯

Enterprise Library 4.1 Configuration的使用 C#模仿QQ截图功能 解决SQL Server Management Studio Express为英文的问题 Visual Studio 2008 简体中文正式版下载及序列号(无使用期限限制,正式版) 程序人生--一个程序员对学弟学妹建议(转) .NET 换肤软件 IrisSkin 2.0 破解版下载及多款皮肤下载 (转)JavaScript 弹出窗口总结 (转)JavaScript常用判断函数(正则表达式版) C#中常用的经典文件操作方法 反编译工具Reflector下载(集成两个常用.net插件,FileGenerator和FileDisassembler) C#遍历指定目录的递归(完美改进版+完整程序源码) C#遍历目录树的递归 在ASP.NET中自动给URL加上超链接 ASP.NET 中 Cookie 的基本知识 ASP.NET2.0统计图表(转) ASP.NET获取IP及电脑名等信息的简单方法+通用类文件源码 (转)了解你的兵器---VS2005 快捷键 Asp.Net Ajax系列(二) 局部页面呈现(Partial-Page Rendering) Asp.net Ajax 系列(一) ----------用了再说
asp.net 中 DropDownList 加入可输入功能解决方案 - 小柯
小柯 · 2008-11-20 · via 博客园 - 小柯

先把这段JS代码放到你页面的HTML中去

function catch_keydown(sel) { switch(event.keyCode) {

case 13: //Enter;

sel.options[sel.length] = new Option("","",false,true);

event.returnValue = false;

break;

case 27: //Esc;

alert("text:" + sel.options[sel.selectedIndex].text + ", value:" + sel.options[sel.selectedIndex].value + ";");

event.returnValue = false;

break;

case 46: //Delete;

if(confirm("刪除當前內容!?")) {

sel.options[sel.selectedIndex] = null;

if(sel.length>0) { sel.options[0].selected = true; } }

event.returnValue = false; break;

case 8: //Back Space;

var s = sel.options[sel.selectedIndex].text;

sel.options[sel.selectedIndex].text = s.substr(0,s.length-1);

event.returnValue = false; break; } }

 function catch_press(sel) {

sel.options[sel.selectedIndex].text = sel.options[sel.selectedIndex].text + String.fromCharCode

(event.keyCode); event.returnValue = false;

 }

然后在你的程序中拖拽一个  DropDownList 控件,在到HTML页中找到这个 控件的 代码

在他后面加上  onkeydown="catch_keydown(this);" onkeypress="catch_press(this);"

运行程序就好了