本人用.net写了一个网站,在网站中我用到了repeater控件,用该控件连接了数据源,但是在运行的时候却看不到数据显示。
其中一段代码如下:
<asp:repeater id="gpcrep" runat="server"><itemtemplate><table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"><Tr><td align="center" bgcolor="#FFFFFF"><a href="laosiall.aspx?id=<%#Container.DataItem("gpctop")%>" title="点击查看"><img src="images/<%#Container.DataItem("gpctop")%>.jpg" border="0" alt="啊啊啊"></a></td><td align="center" bordercolor="#FFFFCC" bgcolor="#FFFFCC"><a class="bottom" href="laosiall.aspx?id=<%#Container.DataItem("gpctop")%>" title="<%#Container.DataItem("gpctop")%>"><%#Container.DataItem("gpclaosi")%></a></td><td valign="top" bgcolor="#FFD9D9"><a class="bottom" href="laosiwz.aspx?id=<%#Container.DataItem("id")%>" target="_blank"><%#Container.DataItem("gpctitle")%></a></td></tr></table></itemtemplate></asp:repeater>
希望各位大虾指点。
其中一段代码如下:
<asp:repeater id="gpcrep" runat="server"><itemtemplate><table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"><Tr><td align="center" bgcolor="#FFFFFF"><a href="laosiall.aspx?id=<%#Container.DataItem("gpctop")%>" title="点击查看"><img src="images/<%#Container.DataItem("gpctop")%>.jpg" border="0" alt="啊啊啊"></a></td><td align="center" bordercolor="#FFFFCC" bgcolor="#FFFFCC"><a class="bottom" href="laosiall.aspx?id=<%#Container.DataItem("gpctop")%>" title="<%#Container.DataItem("gpctop")%>"><%#Container.DataItem("gpclaosi")%></a></td><td valign="top" bgcolor="#FFD9D9"><a class="bottom" href="laosiwz.aspx?id=<%#Container.DataItem("id")%>" target="_blank"><%#Container.DataItem("gpctitle")%></a></td></tr></table></itemtemplate></asp:repeater>
希望各位大虾指点。
解决方案 »
- 为什么突然间vs.net编译器下在暂停调试时察看Int变量都成为非十进制的了
- DataGridViewCheckBoxColumn的状态改变
- 如何把arraylist 转换成 object【】啊?
- js中window.parent.location.href参数太长怎么办?
- 在Form提交的时候怎么得到这个页面上的一个Repeater控件内的值
- 小妹在做一个组卷系统,哪位有这个方面的资料或者是好的网站,给点思路!
- 奇怪的空引用
- 如何TreeView中的节点拖拽到listBox中?是多个TreeView节点的情况!^-^
- 最近新出了个SUSE Linux Enterprise 10的系统,asp.net2.0能在这上运行吗?
- 各位大哥,帮帮我!!!
- 请教如何将子窗口的数据传递到父窗口?
- ASP.NET页面之间传递值的问题?
<HeaderTemplate>
<asp:Label runat="server" Text="Header"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Label runat="server" ID="Lable2" Text=<%# Bind("EmployeeID") %>></asp:Label>
</ItemTemplate>
</asp:Repeater>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
SelectCommand="SELECT top 10 * FROM [Orders]"></asp:SqlDataSource>
所以的<a></a>中都没有设置显示的文本,你绑定的images/ <%#Container.DataItem("gpctop")是否存在?
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://feiyun0112.cnblogs.com/