Velocity Reviews

Velocity Reviews (
-   ASP .Net (
-   -   Determine user-selected text (

Jeff S 01-21-2004 09:46 PM

Determine user-selected text
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.


=?Utf-8?B?VGhvbWFzIEhhIFtNU0ZUXQ==?= 01-23-2004 01:06 AM

RE: Determine user-selected text
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,

DISCLAIMER: This posting is provided "AS IS" with no warranties, and confers no rights.

All times are GMT. The time now is 05:46 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.