自动注册页面 [英] autofocous for a registration page

查看:50
本文介绍了自动注册页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的名字是amit kumar,我正在使用asp.net开发一个网站,我有一个注册页面有一些文本框要填,我想用自动对焦事件,在所有文本框中,

如果有任何解决方案请告诉我

hello to all ,
my name is amit kumar , i am developing a website using asp.net , i have a registration page there are some text boxes to fill , i want to use auto focus event ,in all text-boxes ,
please let me know if is there any solution

推荐答案

public void SetInputFocus()
{
    TextBox tbox = this.loginForm.FindControl("UserName") as TextBox;
    if (tbox != null)
    {
       ScriptManager.GetCurrent(this.Page).SetFocus(tbox);
    }
}


自动对焦意味着视觉元素(文本框)将在页面加载时成为焦点,因此用户将没有必要做任何事情来开始填写表格。根据焦点的性质(以及你的常识的一点帮助),你永远不能同时将注意力集中在多个元素上,因此没有办法为所有文本框设置自动对焦......但是仅限一个......
Autofocus means that a visual element (text box) will be in focus upon the page load, so user will not have to do nothing to start and fill the form. By the nature of focus (and with a little help of your common sense) you never can set focus on more than one element at the same time, so there is no way to set autofocus for "all text-boxes"...but for one only...


这篇关于自动注册页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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