I will preface my question with the disclaimer that I am fairly new to ASP and VB programming and not yet exposed to all the language and framework have to offer.
I am building an ASP site using VB, and I have specific requirements to follow. In the section of the form in question, a series of text boxes collects quantities of an item. Upon postback, the quantities are used to recalculate a total. All of these controls perform the calculation perfectly.
For this form, I am using the OnChange Javascript event to trigger the postback when any of them are modified. This also works correctly. However, when the user clicks or tabs away from the textbox being changed and the postback fires, no control appears to have focus.
I need the focus to be on the control which was clicked by the user, if they clicked onto another control. Is there an event or method by which I can capture the ID of the control which gained focus immediately prior to the postback being triggered? I have seen several questions and answers which demonstrate how to collect the ID of the control which actually triggered the postback, but this would place the focus directly back into the field which was just changed.
Whether the focus is placed into the control which triggered the postback or not, the behavior requires the user to select their next control twice, once to indirectly fire the postback and once to place focus into the desired control.