Web Control TextBox Selection during PreRender

P

Paul C.

Hi folks. I have a WebControl TextBox which I would like to force to select
all it's text during PreRender. My problem is that I don't know how to do
this. I already have a reference to the control by using FindControl(), but
I don't see any method or property I can use to set the selection range. I
am looking for something like SelectionStart() and SelectionLength().

The WinForms TextBox has these methods, but the Web Forms does not. Any
ideas on how to do this?
 
E

Eliyahu Goldin

Paul,

You can do it on client side. Handle body onload event and call select()
method for the <input type=text...> element representing the textbox.

Eliyahu
 
P

Paul C.

Eliyahu,

Thank you. I will try it this route.

Paul C.

Eliyahu Goldin said:
Paul,

You can do it on client side. Handle body onload event and call select()
method for the <input type=text...> element representing the textbox.

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top