Determine user-selected text

Discussion in 'ASP .Net' started by Jeff S, Jan 21, 2004.

  1. Jeff S

    Jeff S Guest

    I would like to provide users with a text box in which they can enter a
    bunch of text (200 bytes or so). I would like to subsequently
    programmatically determine which text the user has selected.

    How can the user selection (selected text) be determined during a postback?
    How about on the client side? Can it be determined without having to first
    post back? I need to understand both ways.

    Thanks.
     
    Jeff S, Jan 21, 2004
    #1
    1. Advertising

  2. Hi Jeff,

    If you need to send the text to the server for processing, you can do the following.

    From the client side, you can insert any text into a hidden serverside text control (TextBox1) with document.all.TextBox1.value = "some selected string". On the serverside, check for Page.IsPostBack == true and get the value from TextBox1.Text.

    Hope this helps,
    Thomas

    DISCLAIMER: This posting is provided "AS IS" with no warranties, and confers no rights.
     
    =?Utf-8?B?VGhvbWFzIEhhIFtNU0ZUXQ==?=, Jan 23, 2004
    #2
    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. Patrick Olurotimi Ige
    Replies:
    6
    Views:
    540
    =?Utf-8?B?TmljZW1hbg==?=
    Mar 11, 2005
  2. xianxian
    Replies:
    3
    Views:
    451
    xianxian
    Jul 21, 2005
  3. Iain
    Replies:
    3
    Views:
    973
  4. Nathan Sokalski
    Replies:
    0
    Views:
    654
    Nathan Sokalski
    Oct 5, 2008
  5. Peña, Botp
    Replies:
    1
    Views:
    266
    Robert Klemme
    Jan 24, 2004
Loading...

Share This Page