急,有关Eval("")数据绑定问题
NavigateUrl= 'imagedetail.aspx?ID= <%#DataBinder.Eval(Container.DataItem, "id ")%> '> 问题出在这,连接后,绑定的数据不能解析,地址栏显示NavigateUrl= 'imagedetail.aspx?ID= <%#DataBinder.Eval(Container.DataItem, "id ")%> '> ,而不是NavigateUrl= 'imagedetail.aspx?ID=3
代码如下:
<%@ Page Language= "C# " %>
<%@ Import Namespace= "System.Data "%>
<%@ Import Namespace= "System.Data.OleDb "%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<script runat= "server ">
</script>
<html xmlns= "http://www.w3.org/1999/xhtml " >
<head runat= "server ">
<title> 无标题页 </title>
</head>
<body>
<form id= "form1 " runat= "server ">
<div>
<asp:DataList ID= "DataList1 " runat= "server " CellSpacing= "8 "
RepeatColumns= "4 " RepeatDirection= "Horizontal " DataSourceID= "AccessDataSource1 " DataKeyField= "id ">
<ItemTemplate>
<asp:Image ID= "Image1 " runat= "server " Height= "152px " ImageUrl= ' <%# Eval( "name ") %> '
Width= "156px " /> <br />
<asp:HyperLink ID= "HyperLink1 " runat= "server " NavigateUrl= 'imagedetail.aspx?ID= <%#DataBinder.Eval(Container.DataItem, "id ")%> '> 详细 </asp:HyperLink>
</ItemTemplate>
</asp:DataList> <asp:AccessDataSource ID= "AccessDataSource1 " runat= "server " DataFile= "~/student.mdb "
SelectCommand=