Ok, I assume this is asp.net + web forms?
When a user hits enter in a text box, usually nothing will occur. However, if you set the text box AutoPostBack="true", then BOTH enter key, or tab will post back. In fact even if you don't change anything in the text box, the page will post back by hitting enter.
Hitting tab will go to the next control on the web page - if you changed text, then both post-back and the text changed stub for that control fires. If you don't change the text box, enter STILL will fire a post back. Now of course if you have mutli-line text box, then enter goes to the next line in that text box (no post-back).
So, with this?
,so the first text box? Yes, the server side text event does fire when you hit tab (but ONLY if you changed the text). The code is this:
Protected Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
Debug.Print("user typed in text box 1 = " & TextBox1.Text)
End Sub
So if I type in this and hit tab?
Output:
user typed in text box 1 = This is some fun text
So, with autopostback = true, then yes, hitting tab will fire/trigger the code behind event stub for that text box.
It not very much recommended to have a lot of post backs on such web pages, but adding auto-post back will then trigger the event code stub for text changed in the code behind.
as noted, enter key does not post back as a general rule, unless you have set auto-post back = true.
To be fair, few people now use enter key, but for a search box, it can be desired.
So the Rosetta stone here is really if you have autopostback=true or not.