471,317 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

Accessing selected text

How can i retrieve the value of highlighted text within a text box?

thank you.


Dec 2 '05 #1
5 1011

Textbox.SelectedText

Steph.
Dec 2 '05 #2
I think you want to use:

TextBox.SelectedText();

HTH
Leigh.

Dec 2 '05 #3

CodeRazor wrote:
How can i retrieve the value of highlighted text within a text box?

thank you.


Simply you can do "textbox_name.SelectedText" without quotes

Dec 2 '05 #4
Ooops - as Steph and Nikola have stated - use the property syntax and
not method call.

Dec 2 '05 #5
???

I get the error below when i try the code you've all suggested.

Web.UI.WebControls.TextBox' does not contain a definition for 'SelectedText'

Should textbox_name.SelectedText be used in the codebehind? javascript?

thanks
Dec 5 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by MattB | last post: by
6 posts views Thread by Bob Alston | last post: by
7 posts views Thread by Chuck Anderson | last post: by
4 posts views Thread by scout3014 | last post: by
reply views Thread by Ignacio Machin ( .NET/ C# MVP ) | last post: by
reply views Thread by Linda Liu[MSFT] | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.