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

      <tfoot id='py9Aa'></tfoot>
      1. <legend id='py9Aa'><style id='py9Aa'><dir id='py9Aa'><q id='py9Aa'></q></dir></style></legend>
          <bdo id='py9Aa'></bdo><ul id='py9Aa'></ul>

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

        文本框宽度问题 - ASP.NET

        时间:2023-06-09

        <legend id='6oEbw'><style id='6oEbw'><dir id='6oEbw'><q id='6oEbw'></q></dir></style></legend>
        <tfoot id='6oEbw'></tfoot>
          <bdo id='6oEbw'></bdo><ul id='6oEbw'></ul>

            <small id='6oEbw'></small><noframes id='6oEbw'>

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

                    <tbody id='6oEbw'></tbody>
                  本文介绍了文本框宽度问题 - ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在生成文本框的网站页面上有一个用户控件.文本框具有指定的宽度,但文本框间歇性地以比代码中指定的宽度小得多的宽度显示.我要求用户向我发送查看源代码"输出的副本,以便我可以比较好的和坏的结果.通过间歇性",我的意思是类似的构建 - 不同的计算机.请注意,坏结果总是显示在相同的坏"计算机上(有不止一个用户遇到此问题),相反,好"计算机(都与坏"计算机使用相同版本的 IE7) 总是显示好"的结果.

                  I have a user control on a page of a website that generates a text box. The textbox has a width specified, but the text box is intermitently being shown at a much smaller width than is specified in the code. I asked the users to send me copies of the "view source" output so that I could compare good and bad results. By "intermittent", I mean similar builds - different computers. Please note that the bad results are ALWAYS displayed on the same "bad" computers (there is more than one user with this problem) and, conversely, the "good" computers (all with the same version of IE7 as the "bad" computers) always display "good" results.

                  页面正确显示后,发送到浏览器的html如下所示:

                  When the page is displayed correctly, the html that is sent to the browser looks like this:

                  <input name="ShortDescription" type="text" maxlength="100" 
                  id="ShortDescription" class="content" style="width:800px;" />
                  

                  当它渲染不正确时,它看起来像这样:

                  and when it renders incorrectly, it looks like this:

                  <input name="ShortDescription" type="text" maxlength="100" 
                  id="ShortDescription" class="content" />
                  

                  在这两种情况下,ASP.NET 代码都是:

                  In both cases, the ASP.NET code is:

                  <asp:textbox id="ShortDescription" runat="server" 
                  CssClass="content" Width="800px" MaxLength="100"> </asp:textbox>
                  

                  我不确定为什么样式标签会被删除.以上页面均在不同计算机上的同一浏览器(IE7)中查看.这些计算机具有公司版本,因此它们应该"配置相同.

                  I am not sure why the style tag is getting dropped. The above pages were both viewed in the same browser (IE7) on different computers. The computers have a corporate build so they "should" be configured the same.

                  我将不胜感激!

                  推荐答案

                  尝试在 CssClass 中设置 TextBox,或者作为样式属性参数而不是使用 Width 属性

                  Try setting the TextBox with in the CssClass, or as a style attribute parameter rather than using the Width attribute

                  <asp:TextBox id="ShortDescription" runat="server" CssClass="content" MaxLength="100" style="width: 800px" />

                  <style>.content { width: 800px }</style>
                  <asp:TextBox id="ShortDescription" runat="server" CssClass="content" MaxLength="100" />

                  这篇关于文本框宽度问题 - ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Win10中的拼写检查文本框 - 慢 下一篇:使用文本框和自定义词典进行拼写会减慢我在 C# WPF 中的应用程序

                  相关文章

                  1. <legend id='bKbMP'><style id='bKbMP'><dir id='bKbMP'><q id='bKbMP'></q></dir></style></legend>
                      <bdo id='bKbMP'></bdo><ul id='bKbMP'></ul>

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

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