如何在asp.net中保持下拉列表的焦点 [英] how to maintain focus of dropdown list in asp.net

查看:58
本文介绍了如何在asp.net中保持下拉列表的焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在asp.net4.0 project.i中工作,我想在正确选择并回发之后选择一个下拉列表,然后控制权转到下一个下拉列表.而不是使用其他控件.我使用Tabindex和ddlcountry.focus()


i m working in asp.net4.0 project.i want select one dropdown list after proper selection and postback occure then control goes to next dropdown. instead of going other control.i m used Tabindex and ddlcountry.focus()

推荐答案

在第一个下拉列表的selection change上写道:
On selection change of first dropdownlist write:
DropDownList2.Focus();


您需要做的只是设置 TabIndex 每个控件的属性...
在您的情况下,如果控件的tabIndex为"5",则将下一个控件的tabIndex属性设置为"6".
如果要设置焦点,则可以使用
All you need to do is set TabIndex property for each of your controls ...
In your case, if tabIndex of your control is ''5'' then set the tabIndex property of the next control you want to move to ''6''..

If you want to set focus then you can do it using
protected void ListBox1_TextChanged(object sender, EventArgs e)
    {
        ListBox2.Focus();
    }


这篇关于如何在asp.net中保持下拉列表的焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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