txtBox.SelectAll() equivalent

K

Ken

Hi

I have a client VB App and I'm usign this useful function to select the text
on the Textbox

txtNum.SelectAll()

I Also have a Web C# App and I want to use a similar function , but I can't
find anything in C#, should I think about JScript?

Any Sug

Ken
 
S

Scott M.

It's not a matter of VB vs. C#. It's a difference between the
System.Windows.Forms.Textbox class and the System.Web.UI.WebControls.Textbox
class. These are 2 different classes and so they don't expose the same
members.

Since you are talking about a web application, you need to ask yourself
*when* you want the text in the textbox to be selected. Do you want it to
happen as the user is entering the text? Before the data is submitted? Or,
after the server has processed the results? This will help you to determine
*where* to write that code. If you determine that it should happen at the
client, then JavaScript is the way to go. If not, it will have to be C#.
 
K

Ken

Umm Ok definetly I want it all the time the textbox got the focus, so now I
think this is Java Script job

thks
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top