Focus

L

Liliana

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
 
A

Alessandro Zifiglio

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 ;)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top