选择ASP:Textbox中的特定文本(多行) [英] Selecting particular Text in ASP:Textbox (multi-line)

查看:92
本文介绍了选择ASP:Textbox中的特定文本(多行)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想在ASP:Textbox(多行)中选择一个特定的文本(单词),因为单击事件后我具有该单词的起始索引和最后索引,我希望在该多行文本框中选择该单词在服务器端编写代码.请告诉我C#代码而不是JavaScript.

在此先感谢

Hi,
I want to select a particular text(word) in ASP:Textbox(multi-line) as I have starting index and Last index of the word on click of event I want that word to be get selected in that multiline text box I want to write code on server side.Please tell me C# code not JavaScript.

Thanks in advance

推荐答案

子字符串将仅返回该子字符串,而不会在文本框中突出显示该单词

AFAIK,您不能在asp:TextBox控件中执行此操作.
您将需要使用 ^ ].

我使用了 http://freetextbox.com/ [ ^ ]有时回到我的示例项目之一.这也将满足您的要求.看一看. :thumbsup:
The Substring will just return that Substring this wont highlight that word in a Textbox

AFAIK, you can''t do this in asp:TextBox control.
You will need to use RichTextBox[^].

I used http://freetextbox.com/[^] sometime back in one of my sample project. This will also do what you require. Take a look. :thumbsup:


document.getElementById(''ASP_CONTROL_ID_HERE'').select();


这篇关于选择ASP:Textbox中的特定文本(多行)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆