asp:datalist id="DataList1" runat="server" Width="976px" ShowHeader="true" ShowFooter="False"
BorderWidth="1px" GridLines="Both" CellPadding="0" BackColor="White" BorderStyle="None" BorderColor="#CC9966">
<selecteditemstyle Font-Bold="True" ForeColor="#663399" BackColor="#FFCC66"></selecteditemstyle>
<headertemplate>
<table width="100%" border="0" cellpadding="3" cellspacing="1">
<tr>
<td width="64" align="center"><font color="#FFFFFF"><strong>类型</strong></font></td>
<td width="82" align="center"><font color="#FFFFFF"><strong>姓名</strong></font></td>
<td width="68" align="center"><font color="#FFFFFF"><strong>性别</strong></font></td>
<td width="104" align="center"><span class="STYLE1">学历</span></td>
<td width="375" align="center"><font color="#FFFFFF"><strong>计划参加培训学习时间</strong></font></td>
<td width="161" align="center"><font color="#FFFFFF"><strong>会员编号</strong></font></td>
<td width="124" align="center"><font color="#FFFFFF"><strong>管理</strong></font></td>
</tr>
</table>
</headertemplate>
<alternatingitemstyle BackColor="Cornsilk"></alternatingitemstyle>
<itemstyle ForeColor="#330099" BackColor="White"></itemstyle>
<itemtemplate>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolorlight="#333333"
bordercolor="#FFFFFF">
<tr>
<td width="60" align="center">
<td width="80" align="center"><a href='member_Edit.aspx?ItemID=<%#DataBinder.Eval(Container.DataItem, "uid")%>'>
<%#DataBinder.Eval(Container.DataItem, "username")%>
</a>
</td>
<td width="60" align="center"><%#DataBinder.Eval(Container.DataItem, "sex")%></td>
<td width="100" align="center"><%#DataBinder.Eval(Container.DataItem, "edu")%></td>
<td align="center"><%#DataBinder.Eval(Container.DataItem, "PlantTime")%></td>
<td width="150" align="center"><%#DataBinder.Eval(Container.DataItem, "UID")%></td>
<td width="120" align="center"><a href='member_edit.aspx?EditID=<%#DataBinder.Eval(Container.DataItem, "uid")%>'>修改</a>
&nbsp; <a href='?DelID=<%#DataBinder.Eval(Container.DataItem, "uid")%>' onClick="return confirm('确认删除吗?');">
删除</a></td>
</tr>
</table>
</itemtemplate>
<footerstyle ForeColor="#330099" BackColor="#FFFFCC"></footerstyle>
<headerstyle Font-Bold="True" ForeColor="#FFFFCC" BackColor="#990000"></headerstyle>
</asp:datalist>
----------------------------
运行怎么显示不了DATALIST控件???????????????????????
就连头部都没的!!
显示空白!
怎么了到底

解决方案 »

  1.   

    绑了
    即使不绑
    也应该显示<tr>
    <td width="64" align="center"><font color="#FFFFFF"><strong>类型</strong></font></td>
    <td width="82" align="center"><font color="#FFFFFF"><strong>姓名</strong></font></td>
    <td width="68" align="center"><font color="#FFFFFF"><strong>性别</strong></font></td>
    <td width="104" align="center"><span class="STYLE1">学历</span></td>
    <td width="375" align="center"><font color="#FFFFFF"><strong>计划参加培训学习时间</strong></font></td>
    <td width="161" align="center"><font color="#FFFFFF"><strong>会员编号</strong></font></td>
    <td width="124" align="center"><font color="#FFFFFF"><strong>管理</strong></font></td>
    </tr>
      

  2.   

    后台的DataList1.DataSource设置了吗,
    绑定了吗?
      

  3.   

    绑定绑定绑定绑定绑定了!!!!!!!!!!
    即使没绑姓名,性别,学历等这些上面头部的应该都要显示的!!!
    问题现在是运行之后DATALIST就是没的!!!!!!!
    运行出来的页查看原文件也没该有的姓名,性别,学历这些内容!!!!
      

  4.   

    〈TABLE width="100%" border="0">
         
                        <TR>
    <TD>DATALIST我放在这个位置</TD>
    <td></td>
    </TR>
    </TABLE>
    ----------------------
    运行出来看源文件发现
    〈TABLE width="100%" border="0">
    <TR>
    <TD>这里根本什么都没的!!!</TD>
    <td></td>
    </TR>
    </TABLE>
      

  5.   

    继续做测试如下:
    <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebYW.WebForm1" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
      <HEAD>
    <title>WebForm1</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
      </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
    <FONT face="宋体">
    <asp:datalist id="DataList1" runat="server">
    <headertemplate>
    <table width="100%" border="0" cellpadding="3" cellspacing="1">
    <tr>
    <td width="318" align="center" bgcolor="#FF0000"><font color="#FFFFFF"><strong>ID</strong></font></td>
    <td width="330" align="center" bgcolor="#FF0000"><font color="#FFFFFF"><strong>分类名称</strong></font></td>
    <td width="291" align="center" bgcolor="#999999"><span class="style1">管理</span></td>
    </tr>
    </table>
    </headertemplate>
    <itemstyle ForeColor="#330099" BackColor="White"></itemstyle>
    <itemtemplate>
    <table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="#FFFFFF">
    <tr>
    <td width="318" align="center">
    888
    </td>
    <td width="330" align="center">88888</td>
    <td width="291" align="center">修改 &nbsp; 删除</td>
    </tr>
    </table>
    </itemtemplate>

    </asp:datalist></FONT>
    </form>
    </body>
    </HTML>
    -------------------------------------------------
    我他吗的这样写总要显示了吧
    可是还是没有!!!!!!!!!!!
    我靠
    !!
      

  6.   

    zsz2005() ( ) 信誉:100    Blog  2006-09-28 15:30:00  得分: 0  
     
     
       把后台代码贴出来啊,光贴前台有P用啊
      
     --------
    为了测试我都不绑定
    直接前台给“定值”不行吗??
      

  7.   

    改成这样 <td width="64" align="center"><font color="#FFFFFF"><strong>类型</strong></font></td>
    <td width="82" align="center"><font color="#FFFFFF"><strong>姓名</strong></font></td>
    <td width="68" align="center"><font color="#FFFFFF"><strong>性别</strong></font></td>
    <td width="104" align="center"><span class="STYLE1">学历</span></td>
    <td width="375" align="center"><font color="#FFFFFF"><strong>计划参加培训学习时间</strong></font></td>
    <td width="161" align="center"><font color="#FFFFFF"><strong>会员编号</strong></font></td>
    <td width="124" align="center"><font color="#FFFFFF"><strong>管理</strong></font></td>
    </tr>
    </table>
    </headertemplate>
    <alternatingitemstyle BackColor="Cornsilk"></alternatingitemstyle>
    <itemstyle ForeColor="#330099" BackColor="White"></itemstyle>
    <itemtemplate>
    <table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolorlight="#333333"
    bordercolor="#FFFFFF">
    <tr>
    <td width="60" align="center">
    <td width="80" align="center"><a href='member_Edit.aspx?ItemID=<%#DataBinder.Eval(Container.DataItem, "uid")%>'>
    <%#DataBinder.Eval(Container.DataItem, "username")%>
    </a>
    </td>
    <td width="60" align="center"><%#DataBinder.Eval(Container.DataItem, "sex")%></td>
    <td width="100" align="center"><%#DataBinder.Eval(Container.DataItem, "edu")%></td>
    <td align="center"><%#DataBinder.Eval(Container.DataItem, "PlantTime")%></td>
    <td width="150" align="center"><%#DataBinder.Eval(Container.DataItem, "UID")%></td>
    <td width="120" align="center"><a href='member_edit.aspx?EditID=<%#DataBinder.Eval(Container.DataItem, "uid")%>'>修改</a>
    &nbsp; <a href='?DelID=<%#DataBinder.Eval(Container.DataItem, "uid")%>' onClick="return confirm('确认删除吗?');">
    删除</a></td>
    </tr>
    </table>
    </itemtemplate>
    <footerstyle ForeColor="#330099" BackColor="#FFFFCC"></footerstyle>
    <headerstyle Font-Bold="True" ForeColor="#FFFFCC" BackColor="#990000"></headerstyle>
    </asp:datalist>
    ----------------------------
      

  8.   

    后台有数据吗??
    没注意datalist,
    像gridview如果没有数据,则head也不显示的
    可能可以设置,但是懒得去搞它了
      

  9.   

    你看看是不是html最前面的设置改过了阿?
      

  10.   

    把代码copy出来,把以前的页面删除,重新做一个
      

  11.   

    初学者~看完代码都晕了
     
    还是偷点分ing ~~
      

  12.   

    不帮定数据源的话datalist就等于没写,当然什么都没有。调试下,看看是不是哪里把绑定又清空了