txtBox.SelectAll() equivalent

Discussion in 'ASP .Net Web Controls' started by Ken, Nov 1, 2004.

  1. Ken

    Ken Guest

    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
     
    Ken, Nov 1, 2004
    #1
    1. Advertising

  2. Ken

    Scott M. Guest

    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#.




    "Ken" <> wrote in message
    news:...
    > 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
     
    Scott M., Nov 1, 2004
    #2
    1. Advertising

  3. Ken

    Ken Guest

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

    thks

    "Scott M." wrote:

    > 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#.
    >
    >
    >
    >
    > "Ken" <> wrote in message
    > news:...
    > > 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

    >
    >
    >
     
    Ken, Nov 1, 2004
    #3
  4. Ken

    Scott M. Guest

    Yep.


    "Ken" <> wrote in message
    news:...
    > Umm Ok definetly I want it all the time the textbox got the focus, so now
    > I
    > think this is Java Script job
    >
    > thks
    >
    > "Scott M." wrote:
    >
    >> 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#.
    >>
    >>
    >>
    >>
    >> "Ken" <> wrote in message
    >> news:...
    >> > 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

    >>
    >>
    >>
     
    Scott M., Nov 2, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer
    Replies:
    0
    Views:
    477
    Kevin Spencer
    Aug 19, 2004
  2. Jim in Arizona

    Strange txtbox errors

    Jim in Arizona, Aug 26, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    458
    Jim in Arizona
    Aug 26, 2005
  3. =?Utf-8?B?U2Vhbg==?=

    Selectall() on texbox

    =?Utf-8?B?U2Vhbg==?=, Apr 20, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    419
    Eliyahu Goldin
    Apr 20, 2006
  4. =?Utf-8?B?eXV2?=

    aspx txtBox value to the .cs file: sending email

    =?Utf-8?B?eXV2?=, Apr 20, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    336
    =?Utf-8?B?eXV2?=
    Apr 20, 2006
  5. Phillip Vong
    Replies:
    3
    Views:
    547
    Phillip Vong
    Oct 20, 2006
Loading...

Share This Page