S
SamoK
Hy!
I'm making a little commenting module for news section of my little
homepage. And I don't know how to embed viewing news comments into it.
I have repeater like this:
<asp:Repeater ID="news" Runat="server">
<ItemTemplate>
<table width="100%">
<tr bgcolor="#c6c8b9">
<td class="newsTitle"><%# DataBinder.Eval(Container.DataItem, "Title")%>
</td>
<td width="100" align="right"><%# DataBinder.Eval(Container.DataItem,
"Date")%> </td>
</tr>
<tr bgcolor="#d5d3ca">
<td colspan="2" class="text"><%# DataBinder.Eval(Container.DataItem,
"Body")%><br><br>
<!-- comments goes right here (somewhere) -->
</td>
</tr>
</table>
<br>
</ItemTemplate>
</asp:Repeater>
I then bind datasource to SqlDataSource (.NET 2.0) -- like this -->
news.DataSourceID = NewsDS.ID; (pretty much no interaction going on here).
I have tables news (columns id, title, body, date) and news_comments
(columns id, body, news_id). news_id is a id of a news to which comment
belongs.
What I don't know is, how to select the correct comments and add them into
the repeater (I've commented the place where I want comments to be).
Can anyone help me with any solution?
-- Samo Kralj
I'm making a little commenting module for news section of my little
homepage. And I don't know how to embed viewing news comments into it.
I have repeater like this:
<asp:Repeater ID="news" Runat="server">
<ItemTemplate>
<table width="100%">
<tr bgcolor="#c6c8b9">
<td class="newsTitle"><%# DataBinder.Eval(Container.DataItem, "Title")%>
</td>
<td width="100" align="right"><%# DataBinder.Eval(Container.DataItem,
"Date")%> </td>
</tr>
<tr bgcolor="#d5d3ca">
<td colspan="2" class="text"><%# DataBinder.Eval(Container.DataItem,
"Body")%><br><br>
<!-- comments goes right here (somewhere) -->
</td>
</tr>
</table>
<br>
</ItemTemplate>
</asp:Repeater>
I then bind datasource to SqlDataSource (.NET 2.0) -- like this -->
news.DataSourceID = NewsDS.ID; (pretty much no interaction going on here).
I have tables news (columns id, title, body, date) and news_comments
(columns id, body, news_id). news_id is a id of a news to which comment
belongs.
What I don't know is, how to select the correct comments and add them into
the repeater (I've commented the place where I want comments to be).
Can anyone help me with any solution?
-- Samo Kralj