Monday, March 26, 2012

Web Control TextBox Selection during PreRender

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?
Paul CPaul,
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
"Paul C." <jaco@.jacostacos.com> wrote in message
news:G1SNd.26862$wi2.3362@.newssvr11.news.prodigy.com...
> 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?
> --
> Paul C
>
Eliyahu,
Thank you. I will try it this route.
Paul C.
"Eliyahu Goldin" <removemeegoldin@.monarchmed.com> wrote in message
news:eAoNLaWDFHA.2180@.TK2MSFTNGP12.phx.gbl...
> 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
> "Paul C." <jaco@.jacostacos.com> wrote in message
> news:G1SNd.26862$wi2.3362@.newssvr11.news.prodigy.com...
> select
> but
> I
>

0 comments:

Post a Comment