<bdo id='hQ1HQ'></bdo><ul id='hQ1HQ'></ul>

<small id='hQ1HQ'></small><noframes id='hQ1HQ'>

  • <legend id='hQ1HQ'><style id='hQ1HQ'><dir id='hQ1HQ'><q id='hQ1HQ'></q></dir></style></legend>

    1. <i id='hQ1HQ'><tr id='hQ1HQ'><dt id='hQ1HQ'><q id='hQ1HQ'><span id='hQ1HQ'><b id='hQ1HQ'><form id='hQ1HQ'><ins id='hQ1HQ'></ins><ul id='hQ1HQ'></ul><sub id='hQ1HQ'></sub></form><legend id='hQ1HQ'></legend><bdo id='hQ1HQ'><pre id='hQ1HQ'><center id='hQ1HQ'></center></pre></bdo></b><th id='hQ1HQ'></th></span></q></dt></tr></i><div id='hQ1HQ'><tfoot id='hQ1HQ'></tfoot><dl id='hQ1HQ'><fieldset id='hQ1HQ'></fieldset></dl></div>

        <tfoot id='hQ1HQ'></tfoot>
      1. 带有“新行"的文本框

        时间:2023-06-09
        <tfoot id='mHveI'></tfoot>

              <i id='mHveI'><tr id='mHveI'><dt id='mHveI'><q id='mHveI'><span id='mHveI'><b id='mHveI'><form id='mHveI'><ins id='mHveI'></ins><ul id='mHveI'></ul><sub id='mHveI'></sub></form><legend id='mHveI'></legend><bdo id='mHveI'><pre id='mHveI'><center id='mHveI'></center></pre></bdo></b><th id='mHveI'></th></span></q></dt></tr></i><div id='mHveI'><tfoot id='mHveI'></tfoot><dl id='mHveI'><fieldset id='mHveI'></fieldset></dl></div>
              • <bdo id='mHveI'></bdo><ul id='mHveI'></ul>

                • <small id='mHveI'></small><noframes id='mHveI'>

                  <legend id='mHveI'><style id='mHveI'><dir id='mHveI'><q id='mHveI'></q></dir></style></legend>
                    <tbody id='mHveI'></tbody>
                  本文介绍了带有“新行"的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我们尝试了几种方法来使文本框接受输入"、换行符等.但我们仍然面临同样的问题.大多数第三方"控件允许用户根据需要设置文本格式.例如,添加颜色、字体、表格等.但是,对于大多数时尚网站,我们不希望用户以这种方式格式化文本.

                  We tried several ways to make a textbox to accept the "enter", newline, etc.. But we are still facing the same problems. Most of the "Third party" controls allow the user to format the text as he wants. Eg, add color, font, table, etc.. However, for most stylish websites, we do not want to allow the user to format the text that way.

                  但我们仍然希望它们输入",因此我们禁用了大多数功能(颜色、粗体、表格、插入图像等).但是我们还有另一个问题,复制和粘贴.在文本框中看到从 MS Word 复制的人并不少见,网站的所有风格都很糟糕!

                  But we still want them to make "enter", so we disable most functions (Colors, bold, table, insert image, etc.). But we still have another problem, copy and paste. It is not uncommon to see people that copy from MS Word in the textbox and wham, all the style of the site is awful!

                  这就是为什么我打开了制作我自己的文本框的可能性,多行(ASP.Net),然后让制作权按Enter"(
                  ).

                  That is why I turn on the possibility of making my own textbox, multiline (the ASP. Net) and just let the right to make press "Enter" (< br / >).

                  最好的方法是什么?

                  我有什么需要注意的提示吗?

                  谢谢!

                  推荐答案

                  设置模式为TextBoxMode.MultiLine

                  在代码隐藏中,

                  myTextBox.TextMode = TextBoxMode.MultiLine
                  

                  或在标记中

                  <asp:TextBox TextMode="MultiLine"
                  

                  当用户在 TextBox 中输入文本时,它会以 形式返回给您.如果您想正确地向用户显示它,您可以使用

                  When the user enters text in the TextBox, it will come back to you with new lines as . If you'd like to display it properly to the user, you could use

                  myTextBox.Text.Replace(Environment.NewLine, "<br />")
                  

                  这篇关于带有“新行"的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:为什么在WPF中TextBox Border Color坚持而不改变? 下一篇:如何只允许在 TextBox 中输入 0 或 1?

                  相关文章

                  <legend id='dU2DB'><style id='dU2DB'><dir id='dU2DB'><q id='dU2DB'></q></dir></style></legend>
                • <small id='dU2DB'></small><noframes id='dU2DB'>

                  • <bdo id='dU2DB'></bdo><ul id='dU2DB'></ul>

                  <tfoot id='dU2DB'></tfoot>

                      <i id='dU2DB'><tr id='dU2DB'><dt id='dU2DB'><q id='dU2DB'><span id='dU2DB'><b id='dU2DB'><form id='dU2DB'><ins id='dU2DB'></ins><ul id='dU2DB'></ul><sub id='dU2DB'></sub></form><legend id='dU2DB'></legend><bdo id='dU2DB'><pre id='dU2DB'><center id='dU2DB'></center></pre></bdo></b><th id='dU2DB'></th></span></q></dt></tr></i><div id='dU2DB'><tfoot id='dU2DB'></tfoot><dl id='dU2DB'><fieldset id='dU2DB'></fieldset></dl></div>