use javascript, for example:
<textarea name="txt1" rows="4" cols="40">Cache items with this priority level are the least likely to be deleted from the cache as the server frees system memory.</textarea>
<input type="text" name="txt2" value="<b>">
<input type="text" name="txt3" value="</b>">
<input type="button" value="insert" onclick="InsertText()">
<script>
function InsertText()
{
  txt1.focus();
  var re = document.selection.createRange();
  re.text = txt2.value + re.text + txt3.value;
}
</script>

解决方案 »

  1.   

    你去javascript版找找,有很多这样的问题
      

  2.   

    在textbox中光标处插入文字示例:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=Content-Type content="text/html; charset=gb2312">
    <SCRIPT>
    function storeCaret(textEl)
    {
    if(textEl.createTextRange)
    textEl.caretPos = document.selection.createRange().duplicate();
    }
    function insertAtCaret(textEl,text){
    if(textEl.createTextRange && textEl.caretPos){
    var caretPos = textEl.caretPos;
    caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == '' ? text + '' : text;
    }
    else
    textEl.value  = text;
    }
    </SCRIPT><META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
    <BODY>
    <FORM name=aForm><TEXTAREA onkeyup=storeCaret(this); onclick=storeCaret(this); name=aTextArea rows=5 cols=80 onselect=storeCaret(this);>测试测试测试测试测试测试</TEXTAREA> 
    <BR><INPUT size=80 value=要插入的文字 name=aText> <BR><INPUT onclick=insertAtCaret(this.form.aTextArea,this.form.aText.value); type=button value=在光标处插入> 
    </FORM></BODY></HTML>
      

  3.   

    下载一个richtextbox,运行后看看它的客户端脚本,没什么可以保密。
      

  4.   

    能不能用VB来实现呢?用asp.net的话,老是提示不支持javascript。
      

  5.   

    你把Javascript当做服务器脚本用了?
      

  6.   

    下载一个HTML在线编辑器来用吧
      

  7.   

    asp.net不支持javascript?
    javescript要放在HTML页面中或在后台代码中直接输出到HTML中,不是直接写在后台代码中的
      

  8.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <script language="JavaScript">
    Function Cuti(){
      content.focus();
      var re = document.selection.createRange();
      re.text = "" + re.text + "";
      }
    </script>
    <body>
    <form name="news" method="post" action="">
      <table width="100%" border="1" cellspacing="0" cellpadding="0">
        <tr> 
          <td><textarea name="content" cols="50" rows="10"></textarea></td>
        </tr>
        <tr> 
          <td><img src="pic/bold.gif" onClick="Cuti();" width="23" height="22"> </td>
        </tr>
      </table>
    </form>
    </body>
    </html>
    saucer(思归, MS .NET MVP) :上面的代码怎么不行?
      

  9.   

    <script language="JavaScript">
    function Cuti(){
      document.news.content.focus();
      var re = document.selection.createRange();
      re.text = "" + re.text + "";
      }
    </script>
      

  10.   

    select a few words, click on the button.....