<asp:textbox></asp:textbox>控件只是普通的文本框输入控件,如果我要用那种按了“回车”,在显示的页面上也能体现出效果的,用什么控件。怎么写,有没有实例。谢谢

解决方案 »

  1.   

    this.TextBox1.Attributes.Add("onChange", " document.getElementById('" + this.Button1.ClientID + "').click();");
    this.TextBox1.Attributes.Add("onKeyDown", "if(event.keyCode==13) event.keyCode=9;");
      

  2.   

    普遍textbox也可以回车后显示回车信息,还支持自动折行,示例如下
    <table style="TABLE-LAYOUT: fixed" width="100%">
    <colgroup>
    <col>
    <col width="20">
    </colgroup>
    <tr>
    <td style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all"><asp:textbox id="txtAssigned" ReadOnly="True" MaxLength="100" Width="100%" TextMode="MultiLine" runat="server"></asp:textbox></td>
    <td align="right"><img style="CURSOR: hand" onclick='ViewLookUp("<%=txtAssigned.ClientID%>","<%=txtAssignedID.ClientID%>","Assigned","True")'src="<% Response.Write(ImageRoot);%>search.gif"></td>
    </tr>
    </table>
      

  3.   

    textmode设为multiline不就能回车了
      

  4.   

    用JAVASCRIPT实现
    或者在表里新增个字段存储编辑属性
    显示的时候就是<font style="+dr["style"]+"></font>
    至于回车换行和空格
    可以用replace实现
    replace("\n","<br>");
    replace(" ","&nbsp;");
      

  5.   

    你有这种需求,那你应该用在线编辑器,推荐一个eWebEditor,功能是我所见过的最强大的.
    你可到以下地址下载(不太稳定,如果打不开页面,过一段时间再打开或直接到google搜索)
    http://www.webasp.net/tech/
      

  6.   

    到下面这个地址去下载在线编辑器ewebeditor,它是我所见过的最好的编辑器了,使用也非常简单,你可试试.http://ewebeditor.webasp.net/features.asp