Select Default Text?
I am using asp.net 2.0 and would like to know if there is a way to have the default text in a textbox automatically selected.
I would like to programatically recreate the effect that you get if you would click in a text box and hit ctrl+a.
I can set the focus to the text box without a problem. I would now just like to select the default text.
If you have any ideas let me know.
[407 byte] By [
dagdamor67] at [2007-11-11 8:17:29]

# 3 Re: Select Default Text?
An asp:textbox is simply an HTML input element. If you're asking, 'Is it possible to highlight all text in a textbox from server-side code,' the answer is no.
# 5 Re: Select Default Text?
Correct. And if you use VBScript, it will only work in Internet Explorer, so I strongly recommend that you use Javascript.