主题:高手请教,点击后总是显示第一项内容。加分!
在主页点击一项后,都会显示第一项。不知道是为什么?改过一次数据库,但并没有报错。请问高手这是怎么回事?
index.aspx:
<asp:datalist id="dl5" runat="server" CssClass="font">
<ItemTemplate>
<a href='sellshow.aspx?id=<%# DataBinder.Eval(Container.DataItem, "id") %>' target=_blank>
<IMG height="7" src="images/dian.gif" width="4" align="absMiddle" border="0"> [<%#DataBinder.Eval(Container.DataItem, "housename") %>]<%# DataBinder.Eval(Container.DataItem,"address")%>
</a>
</ItemTemplate>
</asp:datalist>
index.aspx.cs:
sql="select top 10 id,housename,address,pubtime from sell order by id desc";
ds=hsjdata.dbbind(sql);
dl5.DataSource=ds.Tables["mytable"].DefaultView;
dl5.DataBind();
index.aspx:
<asp:datalist id="dl5" runat="server" CssClass="font">
<ItemTemplate>
<a href='sellshow.aspx?id=<%# DataBinder.Eval(Container.DataItem, "id") %>' target=_blank>
<IMG height="7" src="images/dian.gif" width="4" align="absMiddle" border="0"> [<%#DataBinder.Eval(Container.DataItem, "housename") %>]<%# DataBinder.Eval(Container.DataItem,"address")%>
</a>
</ItemTemplate>
</asp:datalist>
index.aspx.cs:
sql="select top 10 id,housename,address,pubtime from sell order by id desc";
ds=hsjdata.dbbind(sql);
dl5.DataSource=ds.Tables["mytable"].DefaultView;
dl5.DataBind();