Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Determine user-selected text (http://www.velocityreviews.com/forums/t71166-determine-user-selected-text.html)

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.

Thanks.



=?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,
Thomas

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


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

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