开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜