In my ASP.Net form, there is a text box and a button. When the user clicks the button, it adds text to an ASP:TextBox during a postback (it adds a specific "starter text"). After the postback, I want the focus to be set to the end of the text in the textbox.
When I try to call Page.SetFocus(...) or txtBox.Focus(), the text box gets focused but at the beginning of the text. This can lead to the user typing in the wrong place.
For example:
cursor
100-01
I would like it to appear as:
100-01cursor
I attempted the following code in the textbox:
onfocus="alert('focus');this.value = this.value;"
However, the "alert" only shows up the first two times. After that, nothing happens.