Focus

Discussion in 'ASP .Net Web Controls' started by Liliana, Dec 24, 2003.

  1. Liliana

    Liliana Guest

    I am creating an asp.net page.
    When this page is loaded I need the focus to be on a text box.
    (The user will use a barcode scanner to scan some data in the text
    box).
    Also when the focus moves to another textbox on the page I need to do
    some processing of the string that was entered in the first textbox.
    Please let me know if this is possible and how.

    Thank you,

    Liliana
    Liliana, Dec 24, 2003
    #1
    1. Advertising

  2. hi Liliana,
    Despite the lack of a server-side Focus property on Web Controls, you can create a custom FocusManager Web Control that sets the focus to any other control on the page that you choose. You specify which control should receive the focus with a String property called BoundControlID. This will require some work, follow the article I've pasted below. The end product is a custom web control you can use on your pages to set focus on any element you choose. As for the processing you need to do when focus is moved to another element in your case another textbox, that you will have to code yourself, again in javascript. All these events take place on the client. Javascript is the way to go.
    Heres the link to the FocusManager Web Control :
    http://archive.devx.com/dotnet/articles/rj121801/rj121801-1.asp

    Merry christmas ;)


    "Liliana" <> wrote in message news:...
    > I am creating an asp.net page.
    > When this page is loaded I need the focus to be on a text box.
    > (The user will use a barcode scanner to scan some data in the text
    > box).
    > Also when the focus moves to another textbox on the page I need to do
    > some processing of the string that was entered in the first textbox.
    > Please let me know if this is possible and how.
    >
    > Thank you,
    >
    > Liliana
    Alessandro Zifiglio, Dec 24, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason
    Replies:
    4
    Views:
    1,589
    Jason
    May 7, 2007
  2. Replies:
    2
    Views:
    325
    Thomas 'PointedEars' Lahn
    Jun 6, 2005
  3. Roger
    Replies:
    3
    Views:
    304
  4. Jeff

    manual focus vs. focus()

    Jeff, May 20, 2007, in forum: Javascript
    Replies:
    4
    Views:
    169
  5. Spizzat2
    Replies:
    2
    Views:
    169
    Spizzat2
    Jan 9, 2008
Loading...

Share This Page