郁闷了一天的问题结果还有问题(我承认自己很SB)

gundamtw gundamtw 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我是用VS2005+access做留言板的那个 用的是 <asp:Repeater><ItemTemplate><table>......../ItemTemplate></asp:Repeater>
这样的 另外留言和回复是2个表 sql语句是2表关联查询:string sql = "select a.[Name] as AName,a.[Title],a.[Content] as AContent,a.[Publishdate],a.[ImageURL],b.[Name] as BName,b.[Content] as BContent,b.[Returndate] from Mes a left join Reply b on a.ID=b.MesID
页面代码:
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>

<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td style="height:32px;width:100px; background-color:Blue; text-align:left">
发帖者:<%# Eval("AName")%>
</td>
<td style="height:32px; width:400px; background-color:White; text-align:left">

标题:<%# Eval("Title")%>
</td>
</tr>
<tr>
<td style="height:150px; width:100px; background-color:White; text-align:center">
<asp:Image ID="Image1" runat="server" ImageUrl="~/behindimages/pic1.gif" />
</td>
<td style="height:32px; width:400px; background-color:Green; text-align:center;" rowspan="2">
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td style="height:32px; width:400px; background-color:Fuchsia; text-align:left">
内容:<%# Eval("AContent")%>
</td>
</tr>
</table>

<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td style="height:32px; width:400px; background-color:Transparent; text-align:left">
回复人:<%# Eval("BName")%>
</td>
<td style="height:32px; width:400px; background-color:Transparent; text-align:left">
回复时间:<%# Eval("Returndate")%>
</td>

</tr>
<tr>
<td style="height:32px; width:400px; background-color:Transparent; text-align:left" colspan="2">
回复内容:<%# Eval("BContent")%>
</td>
</tr>
</table>

</td>
</tr>
<tr>
<td style="height:32px; width:100px; background-color:Red; text-align:left">
发帖时间:<%# Eval("Publishdate")%>
</td>
<td></td>
</tr>
</table>

</ItemTemplate>
</asp:Repeater>

基本的现在可以显出来了 不过问题又来了 这样不能像Gridview一样自己分页 全部显示到一列了 而且还有个问题是留言头像怎么让他绑定我查询出来的图片路径 还有就是留言如果没回复就显示暂无回复 而不是还继续这样显示出回复人、回复时间还都是空的 拜托各路高手来指点一下 小的感激涕零~ 不能在线= 要明天才上了 能解决的希望大家帮忙下
路过的也帮忙Up一下啊 谢谢了
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
gundamtw
.NET社区 62,272 成员 668,968 内容