我该如何关联的输入与一个aspx页面上的一个按钮键? [英] How do I associate the Enter key with a button on an aspx page?

查看:137
本文介绍了我该如何关联的输入与一个aspx页面上的一个按钮键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个asp.net ascx控件文件,我已经把一个aspx页面上的控制。 ASPX页面具有这样的时候我preSS在键盘上输入,我希望它火按钮的事件处理程序的按钮。有没有一种方法来设置此?

I have an asp.net ascx control file and I have put the control on an aspx page. The aspx page has a button in which when I press enter on the keyboard, I want it to fire the event handler for the button. Is there a way to set this?

我使用一个按钮母版页已经在了,所以现在当我preSS回车键时,该按钮触发事件处理程序。

I am using a master page with a button already on it, so now when I press the enter key, the event handler for that button fires.

推荐答案

DefaultButton也适用于面板,这样你就可以在每个面板中设置默认按钮,并有Enter键单击任何面板当前具有焦点的按钮。

DefaultButton also works in panels, so you can set a default button in each panel and have the Enter key click the button in whichever panel currently has focus.

这篇关于我该如何关联的输入与一个aspx页面上的一个按钮键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆