全部是默认设置,添加了模版后查看就只能显示偶数行,又放了datagrid来测试,datagrid又是对的,数据集里有数据,但是怎么只能显示偶数行?
<asp:DataList id="ViewTopic" runat="server" RepeatLayout="Flow" Width="100%" Height="100%" ShowHeader="False"
ShowFooter="False" EnableViewState="False">
设置如下,请那位大虾诊断下

解决方案 »

  1.   

    RepeatLayout="Flow" 换成 RepeatLayout="Table" 试试
      

  2.   

    把你的datalist拌定的代码也贴上来啊。你这样的代码是没问题的,肯定是哪里错了。你没帖全!
      

  3.   

    <asp:datalist id="score" runat="server" Width="780" Height="80px">
    <headertemplate>
    </headertemplate>
    <itemtemplate>
    <table width="780" border="0" cellpadding="0" cellspacing="0">
    <tr id="chk" height="30" Runat="server">
    <td width="780" rowspan="1" class="zhong13h"><a href='trydetail.aspx?id=<%# DataBinder.Eval(Container.DataItem,"id").ToString() %>' target=_blank>
    <%# CutString(DataBinder.Eval(Container.DataItem,"title").ToString(),27) %>
    </a>
    </td>
    </tr>
    </table>
    </itemtemplate>
    <table width="780" border="0" cellpadding="0" cellspacing="0">
    <tr id="chk" height="30" Runat="server">
    <td width="780" rowspan="1" class="zhong13h"><a href='trydetail.aspx?id=<%# DataBinder.Eval(Container.DataItem,"id").ToString() %>' target=_blank>
    <%# CutString(DataBinder.Eval(Container.DataItem,"title").ToString(),27) %>
    </a>
    </td>
    </tr>
    </table>
    </alternatingitemtemplate>
    </asp:datalist>
    这个是好的,你参考的改改
      

  4.   

    显示的内容要写到<itemtemplate>里你可能写成另一个呢
      

  5.   

    估计是添加了<AlternatingItemTemplate></AlternatingItemTemplate> 
    但里面没有绑定数据
      

  6.   

    datalist与datagrid,都有一个交替行的属性,你如果不小心点击了交替行,导致它生成了交替行的代码,但又没有做相应的绑定,就会出现这种情况 .
    你检查一下你的页面代码.
      

  7.   

    去掉html代码中datalist里的<AlternatingItemTemplate></AlternatingItemTemplate>
      

  8.   

    楼上的分析的有理.可能是AlternatingItemTemplate造成的.所以,你最好把你的代码贴出来再做决定.