ASP page get current focused control
So what I have is a bunch of dynamically created textboxs that when the user enters some data and either tabs out or clicks out some calculations are done. After the pag开发者_JS百科e posts back control focus is lost. What I need is to be able to set focus back to the control that was tabbed to or clicked into not the control that data was entered into.
You'll have to send information about that control in the post. What happens in a postback is the the browser completely discards the current DOM and loads a brand new one, so to keep your place you'll have to tell your server where your place was and have javascript code that runs on page load to put things back.
Other options include doing this either entirely in javascript or using an ajax partial postback.
精彩评论