<FooterTemplate><a href ="../PostList.aspx?id=<%#Eval("TypeId") %>">>更多</a></FooterTemplate>
这个是在DataList的页脚模板里写的一个绑定。select top 10 PostId,Title,P_Date,UserName,TypeName,Post.TypeId from Post,Type where Post.TypeId=Type.TypeId and Post.TypeId=1 order by Post.L_Date desc这个是我们的一个查询语句在运行的时候,PostList.aspx?id= 后面获取不到值。而使用这个查询语句在查询分析器里执行后的结果中有TypeId这一列,里面也有值的。不知道为什么这里显示不出来。请大家指教.
这个是在DataList的页脚模板里写的一个绑定。select top 10 PostId,Title,P_Date,UserName,TypeName,Post.TypeId from Post,Type where Post.TypeId=Type.TypeId and Post.TypeId=1 order by Post.L_Date desc这个是我们的一个查询语句在运行的时候,PostList.aspx?id= 后面获取不到值。而使用这个查询语句在查询分析器里执行后的结果中有TypeId这一列,里面也有值的。不知道为什么这里显示不出来。请大家指教.
这样写试试或者查询这样写 select top 10 PostId,Title,P_Date,UserName,TypeName,Post.TypeId as TypeId from Post,Type where Post.TypeId=Type.TypeId and Post.TypeId=1 order by Post.L_Date desc 如果还不行,就跟下断点,看看那个查询返回的ds的列的值是多少...
Eval("属性").ToString()才行``不然不是一个值类型