Focus () method asp net

1

I have a page with several controls, when I trigger an event of a button I want the focus to go to a textBox that is down there, but this is not happening simply by putting the method focus() on textBox . Does any other control like listBox interfere? Because in this event that I try to focus on textBox I'm also passing an index so that an item of listBox : listBox.SelectedIndex = 0 is selected. Could it also be a scope problem? For example, this textBox that should receive focus is in panel . I want this textBox to get focus and the page to go down (the horizontal bar) to it, understand?

    
asked by anonymous 31.12.2016 / 23:54

1 answer

1

I did it in JavaScript:

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

There it went.

    
01.01.2017 / 01:11