<ItemTemplate>
                <tr height   = "25">
                    <td colspan = "3"><span class = "text">
                    <%# DataBinder.Eval(Container.DataItem, "ProductID") %></span></td>
                    <td colspan = "4"><span class = "text">
                    <%# DataBinder.Eval(Container.DataItem, "ProductName") %></span></td>
                </tr>
            </ItemTemplate>编译错误:Validation (XHTML 1.0 Transitional): Attribute 'height' is not a valid attribute of element 'tr'.
怎么解决啊,为什么编译有错也能运行?

解决方案 »

  1.   

    这不是编译错误,是html校验错误
      

  2.   

    究竟为什么错了,msdn中说tr有height属性的
      

  3.   

    <tr height=25px> 
      

  4.   

    HTML标准的问题,我习惯用style="width:25px"
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      

  5.   

    标准做法是在style里面设置的,这种写法不符合标准,不过在IE里面是兼容的
      

  6.   

    由于你在html第一行添加了dtd验证文件
    所以你写的这个属性不标准,验证不通过
    修改如下:
    <tr style="height:200;">