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

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
PCI Perspectives
PCI Perspectives
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
量子位
博客园_首页
S
SegmentFault 最新的问题
S
Secure Thoughts
F
Full Disclosure
H
Hacker News: Front Page
博客园 - 三生石上(FineUI控件)
U
Unit 42
H
Heimdal Security Blog
N
News and Events Feed by Topic
A
About on SuperTechFans
C
CERT Recently Published Vulnerability Notes
Cyberwarzone
Cyberwarzone
Help Net Security
Help Net Security
The Hacker News
The Hacker News
L
LINUX DO - 最新话题
Application and Cybersecurity Blog
Application and Cybersecurity Blog
罗磊的独立博客
N
News | PayPal Newsroom
Spread Privacy
Spread Privacy
C
Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
云风的 BLOG
云风的 BLOG
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Simon Willison's Weblog
Simon Willison's Weblog
B
Blog
人人都是产品经理
人人都是产品经理
TaoSecurity Blog
TaoSecurity Blog
博客园 - 【当耐特】
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
I
InfoQ
D
DataBreaches.Net
大猫的无限游戏
大猫的无限游戏
Apple Machine Learning Research
Apple Machine Learning Research
L
LINUX DO - 热门话题
Google Online Security Blog
Google Online Security Blog
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
Know Your Adversary
Know Your Adversary
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog RSS Feed

博客园 - Emmet.C

[求助]关于Vsiual Studio.NET 2005中Error List种错误的定位问题 【求助】关于asp.net中的'Thread was being aborted'异常 安装Tomcat 5.0.28备注 如何在运行时定制DataGrid的显示风格? Jbuilder2005安装备注 使用Singleton改善ASP.NET性能备注 Infragistics.WebUI.UltraWebTab.v4.3使用备注 WinForm界面模式 如何定制WebCarlendar类型控件的星期格式 .NET在Debug模式下的编译错误 DataGrid动态绑定 Infragistics UltraWebTab的奇怪问题 架构设计备注(用户以及操作权限管理) 关于通过手机收发短信的相关资源 Read CPU ID(from CSDN) 可用性相关的资料站点 万网企业邮箱开始提供垃圾邮件过滤功能了 为何使用表格排版是不明智的? 申请了GMail
asp.net中如何回车触发指定按钮的事件
Emmet.C · 2005-02-22 · via 博客园 - Emmet.C

问题内容:
在asp.net中,如何回车触发指定按钮的事件?
假设:
<asp:TextBox id="tbInput" runat="server" Width="240px"></asp:TextBox>
<asp:Button id="btnOK" runat="server" BorderWidth="1px" BorderColor="Purple" BorderStyle="Solid" Text="Search Site"></asp:Button>

解决方法:
在.aspx页面中添加:
<SCRIPT LANGUAGE="javascript">
function SubmitKeyClick(button)
{   
 if (event.keyCode == 13)
 {       
  event.keyCode=9;
  event.returnValue = false;
  document.all[button].click();
 }
}
// -->
</SCRIPT>

在Page_Load事件中添加:
tbInput.Attributes.Add("onkeydown","SubmitKeyClick('btnOK');");