Determine user-selected text

  • Thread starter Thread starter Jeff S
  • Start date Start date
J

Jeff S

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

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

Back
Top