谢谢
我用<%#DataBinder.Eval(Container.DataItem,"imgUrl")%>没有显示数据,整页代码如下,还需要在后台.cs文件中作什么设置么?麻烦在帮忙看一下,谢谢了。
<%@ Page language="c#" Codebehind="viewPhoto.aspx.cs" AutoEventWireup="false" Inherits="MyWeb.viuePhoto" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>图片显示</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="
http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body bottomMargin="0" leftMargin="0" background="image/backhead.gif" topMargin="0" rightMargin="0">
<DIV align="center">
<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="780" border="0">
<TR>
<TD>
<P align="center"><asp:image id="Image1" runat="server" Height="120px" Width="142px"></asp:image><asp:textbox id="TextBox1" runat="server"></asp:textbox></P>
<P align="center">
<asp:datalist id=dlPhoto runat="server" Height="208px" Width="674px" RepeatColumns="4" RepeatDirection="Horizontal" DataSource="<%# dataSet11 %>" BorderWidth="3px" BorderColor="Black">
<ItemTemplate>
<TABLE id="Table2" style="WIDTH: 135px; HEIGHT: 128px" cellSpacing="1" cellPadding="1"
width="135" border="0">
<TR>
<TD vAlign="middle" align="center">
<A href="viewPhoXX.aspx?page=<%# DataBinder.Eval(Container.DataItem,"imgUrl").ToString()%>">
<IMG style="WIDTH: 135px; HEIGHT: 135px" height=120 alt="" src='<%# DataBinder.Eval(Container.DataItem,"imgUrl").ToString()%>' width=136>
</A>
</TD>
</TR>
</TABLE>
<asp:Label id="Label1" runat="server" Font-Size="X-Small">
<%# DataBinder.Eval(Container.DataItem,"imTitle").ToString()%>
</asp:Label>
</ItemTemplate>
</asp:datalist></P>
</TD>
</TR>
</TABLE>
</FONT>
</form>
</DIV>
<P align="center"><uc1:foot id="Foot1" runat="server"></uc1:foot></P>
<DIV align="center"><FONT face="宋体"></FONT> </DIV>
</body>
</HTML>