asp.net中的“焦点"按钮 [英] focus button in asp.net

查看:68
本文介绍了asp.net中的“焦点"按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

海,

在网页中,当用户按Tab键时,应该只关注保存按钮.


任何想法的人,

Hai,

In Webpage when user press tab key it should focus only save button.


any ideas guys,

推荐答案

您可以覆盖控件"
You can override the Controls'' KeyDown[^] event and manually move the focus over to the Control that should receive focus.


您可以使用

you can use

<body onkeydown="kd();"></body>







function kd()
{
    if(event.keyCode==9)
    {
        document.getElementById("btn").focus();
    }
}


设置按钮属性

Set Button Property

<asp:button id="button1" tabindex="1" runat="server"/>


这篇关于asp.net中的“焦点"按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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