标签并输入按钮 [英] tab and enter buttons

查看:77
本文介绍了标签并输入按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的页面上有两个按钮.
一键是提交"按钮,一键是取消"按钮.

除了使用鼠标外,我还想使用选项卡"按钮和输入"按钮.

单击选项卡后,当控件位于提交"按钮上时,单击输入"按钮应引发提交事件.在单击选项卡上,将控件置于取消"按钮上时,单击输入"按钮应引发取消"事件.

当我浏览网络时,会看到使用面板和默认按钮的示例,但是我需要更多的默认按钮.
根据控件处于打开状态的按钮,按Enter键应适当调用该按钮的事件.

问候,
NetQuestions

Hi,

I have two buttons on my page.
One button is ''Submit'' button and one button is ''Cancel'' button.

I want to use the ''tab'' button and the ''enter'' button in addition to using mouse.

After clicking tab, when control is on ''submit'' button, the click of ''enter'' button should raise the submit event. On clicking tab, when control is on ''Cancel'' button, the click of ''enter'' button should raise the Cancel event.

When I browse the net, I see examples of using panel and default button, however I need more that default button.
Depending upon which button the control is on, hitting enter button should appropriately call the event of that button.

Regards,
NetQuestions

推荐答案


只需将一个asp面板以..的形式放置,确保包括按钮在内的整个控件都在面板内部.然后将默认按钮设置为ur提交按钮..
希望对您有所帮助.

just place an asp panel in the form ..make it sure that the whole control including the buttons are inside the panel..then set the default button as ur submit button..
Hope this may help you..


当控件位于提交"按钮上时,单击输入"按钮将引发Submit事件.
当控件位于取消"按钮上时,单击输入"按钮应引发取消"事件.


这是正常现象,您无需为此编写任何代码.按下Enter键后,将执行具有焦点的控件的默认事件.

您所了解的面板和默认按钮是关于页面加载的默认焦点.如果您明确使用制表符来专注于按钮,则不需要此默认按钮功能.一旦您将焦点放在提交"按钮上,按Enter就会引发提交"按钮单击事件.同样,一旦将焦点移到取消"按钮上并按Enter键,则会引发取消"按钮单击事件.
when control is on ''submit'' button, the click of ''enter'' button should raise the submit event.
when control is on ''Cancel'' button, the click of ''enter'' button should raise the Cancel event.


This IS the normal behavior and you don''t need to write any code for it. On pressing enter, default event of the control having the focus is executed.

What you read about panels and default button is about having a default focus on page load. If you are using tab explicitly to focus on buttons then you dont need this default button feature. Once your focus is on ''submit'' button, pressing enter would raise submit button click event. Similarly, once you shift your focus to ''cancel'' button and press enter - it would raise cancel button click event.


Sandeep,由于某种原因,这是行不通的.

这是因为我在更新面板上有一个计时器控件吗?

可能是因为我有计时器,所以即使我将选项卡和焦点放在提交"按钮上,焦点也会丢失吗?

如果我按Enter 5至6次,则尝试之一将起作用!!!
问候,
Maneesh Menon
Sandeep, for some reason this is not working.

Is this because I have a timer control on the update panel?

Could it be that because I have timer, even if I tab and focus is on ''Submit'' button, the focus gets lost?

If I press enter some 5 to 6 times, in one of the attempt it will work!!!
Regards,
Maneesh Menon


这篇关于标签并输入按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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