Focus() net Asp method

Asked

Viewed 91 times

1

I have a page with several controls, when I trigger an event from a button I want the focus to go to a textbox that is below the page, but this is not happening simply by putting the method focus() in the textBox. Did some other control like a listBox is interfering? Because in this event I try to put the focus on a textBox I am also passing an index in order to be selected an item from listBox: listBox.SelectedIndex = 0. Could it also be a scope problem? For example, this textBox that should receive the focus stays on another panel. I want that one textBox get the focus and let the page descend (the horizontal bar) to it, understand?

1 answer

1


Fiz em Javascript:

document.getElementById("textBox").focus();

Then it worked.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.