I'm trying to find a control based on the ClientID of an object. When I find the control with the last focus, I'd like the focus to return to the returned to this control.
For example, I have a texbox and a dropdown on the screen in that order. The textbox has a textchanged command. When i tab to the dropdown, I want the focus to be retained in the dropdown without any "screen flashing".
My best option was to create a hidden field and setup an onfocus event for every control on the page that updates this hidden field.
On a postback, I am retrieving this hidden text field value that contains the ClientID of the last focused control on the page. When I use the FindControl command, the Control is null.
The problem is that I am using MasterPages and User Web Controls that add the prefix of the naming container to the ClientID.
Is this the best option to keep the focus on postback or is there a way to map the ClientID to the serverID without looping through all the controls on the page one by one?