【问题标题】:HTML attribute disabled="disabled" doesn't work with IE8HTML 属性 disabled="disabled" 不适用于 IE8
【发布时间】:2009-09-14 09:46:00
【问题描述】:

我有一个 ASP.NET MVC 应用程序。 aspx里面的代码是这样的

<input '<%= ViewData["Disabled"] %>' class="Text1" type="text" name='test' value='0'/>

ViewData["Disabled"] 在此状态下包含一个字符串 =

'disabled="disabled"'

Firefox 中的结果:

<input class="Text1" type="text" value="0" name="test" disabled="disabled"/>

IE8 中的结果:

<input name="test" class="Text1" type="text" ?="" ?disabled="disabled" value="0"/>    

为什么是这样的输出?

【问题讨论】:

    标签: html model-view-controller input internet-explorer-8


    【解决方案1】:

    也许尝试去掉封闭的单引号:

    <input <%= ViewData["Disabled"] %> class="Text1" type="text" name='test' value='0'/>
    

    【讨论】:

      【解决方案2】:

      我认为可能是引号

      试试:

      <input <%= ViewData["Disabled"] %> 
             class="Text1" 
             type="text" 
             name='test' 
             value='0'/>
      

      善良,

      丹

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-08-16
        • 2021-07-18
        • 2016-10-29
        • 1970-01-01
        • 2015-12-13
        • 2017-09-10
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多